My bullet acceleration is going CRAZY. I'm trying to make a code where a bunch of these white bullets drift downwards with varying accelerations in one direction or another, just slightly (think Chen's spellcard in PCB). However, crazy CRAZINESS has been happening. First, when I set the x-velocity maximum to 99, in a crude attempt to get rid of maxima (because I was trying to fix an earlier problem which I will detail shortly), the bullets all leapt to the edge of the screen like they were trying to outrun the swine flu, I swear to god. They might as well have VANISHED. The best part was that I defined the x-acceleration to be 0.00001, and yet they still fled like it was a freaking pandemic.
But the story does not end there, my friend. I tried using rand(-0.05, 0.05) to make the drift randomized, but instead, they all just drifted to one side... aah, see for yourself. The effects are really strange (moreover, I don't get why half the bullets dive to one side, and the other half drift the way they're supposed to).
No comments about how this spell would be impossible even if it COULD work. It's a work in progress atm, and that's why the code is haphazard and flying all over the place.
#TouhouDanmakufu
#Title[Cloud Sign "The Moryo are Silently Watching"]
#Text[Spell card 02]
#Player[FREE]
#ScriptVersion[2]
script_enemy_main {
let ImgBoss = "script\img\ExRumia.png";
let frame = 0;
let frame2 = 150;
#include_function "lib\SHOT_REPLACE\shot_replace.dnh"
@Initialize {
SetLife(2000);
SetTimer(120);
SetScore(1000000);
SetMovePosition02(GetCenterX, GetClipMinY + 120, 120);
CutIn(YOUMU, "GOD DAMN ASS SHIT BOB SAGET", "", 0, 0, 0, 0);
LoadGraphic(ImgBoss);
SetTexture(ImgBoss);
SetGraphicRect(0, 0, 64, 64);
TMain;
shotinit;
}
@MainLoop {
SetCollisionA(GetX, GetY, 32);
SetCollisionB(GetX, GetY, 16);
yield;
if(frame%20 == 0 && frame >= 0){
Moryo(frame2);
frame2 -= 20;
}
if(frame == 80){
frame2 = 150;
frame = -120;
}
frame++;
}
@DrawLoop {
DrawGraphic(GetX, GetY);
}
@Finalize {
DeleteGraphic(ImgBoss);
}
task TMain{
yield;
TMove;
}
task TMove{
let stepsize = (GetClipMaxX - GetClipMinX - 60)/4;
let move_y = GetCenterY + rand(30, 120);
let move_x = GetClipMinX + 30;
let disc = 1;
SetMovePosition03(move_x, move_y, 3, 10);
loop{
loop(4){
move_y = GetCenterY - rand(30, 120);
if(disc == 1){
move_x += stepsize;
}else{move_x -= stepsize;}
SetMovePosition03(move_x, move_y, 3, 10);
loop(20){yield;}
}
disc = -1*disc;
loop(120){yield;}
}
}
function Moryo(frame_b){
let angle_m = rand(0,360);
loop(8){
CreateShotA(0, GetX, GetY, 1);
SetShotDataA(0, 0, 10, angle_m, 0, -1, 0, WHITE03);
SetShotDataA(0, 7, 0, 0, 0, 0, 0, WHITE03);
SetShotDataA_XY(0, frame_b, 0, 0.1, rand(-0.01, 0.01), 0.1, 3, 5, WHITE03); //GOD DAMN THIS LINE OF CODE. GOD DAMN IT TO HELL
angle_m += 45;
FireShot(0);
}
loop(16){
CreateShotA(1, GetX, GetY, 1);
SetShotDataA(1, 0, rand(7, 11), rand(0, 360), 0, -1, 0, WHITE04);
SetShotDataA(1, 7, 0, 0, 0, 0, 0, WHITE04);
SetShotDataA_XY(1, frame_b - 10, 0, 0.2, 0, 0.1, 99, 3, WHITE04);
FireShot(1);
}}
}
Enjoy this madness. Oh, and set the x-max to 99 to watch the BULLET JIG OF THE CENTURY. Oh ya, and I used the bullet replace script, but every cool kid in danmakufu should have that by now (I used pretty standard bullets anyway, but I dunno what will happen if it can't find the script)