Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu
- #ScriptVersion[2]
- #Title[Trailing Bullet]
- #Text[A trailing bullet]
- #Player[FREE]
- script_enemy_main{
- @Initialize{
- SetLife(1000);
- SetMovePosition01(GetCenterX,GetCenterY-100,5);
- TMain;
- }
- @MainLoop{
- yield;
- }
- @DrawLoop{
- }
- @Finalize{
- }
- task TMain{
- wait(120);
- TFire;
- }
- task TFire{
- loop{
- ascent(angle in 0..16){
- Bubblebullet(GetEnemyX,GetEnemyY,1,angle*22.5,0.1,BLUE03,30); //fires a bubble bullet that curves and spawns bullets
- }
- wait(240);
- }
- }
- task Bubblebullet(x,y,speed,angle,angularvelocity,graphic,delay){
- let obj = Obj_Create(OBJ_SHOT);//creates an object bullet
- let count = 0;//counter variable
- Obj_SetPosition(obj,x,y);//sets posiiton
- Obj_SetSpeed(obj,speed);//sets speed
- Obj_SetAngle(obj,angle);//sets angle
- ObjShot_SetGraphic(obj,graphic);//sets graphic
- ObjShot_SetDelay(obj,delay);//sets delay
- while(!Obj_BeDeleted(obj)){//while the object is not deleted, do...
- Obj_SetAngle(obj,Obj_GetAngle(obj)+angularvelocity);//increase the angle by a small amount, making the bullet curve.
- if(count==30){
- CreateShotA(0,Obj_GetX(obj),Obj_GetY(obj),15);//a bullet that spawns without moving, then gradually accelerates.
- SetShotDataA(0,0,0,rand(0,359),0,0,0,RED01);
- SetShotDataA(0,60,0,NULL,0,0.01,2,RED01);
- FireShot(0);
- count = 0;
- }
- count++;
- yield;
- }
- }
- function wait(w){ loop(w){ yield;}}
- }
Advertisement
Add Comment
Please, Sign In to add comment