Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script_enemy_main{
- let CSD = GetCurrentScriptDirectory;
- let imgFam = CSD ~ "system\familiar.png";
- let spin = 0;
- let FamAngle = GetArgument;
- let shot0 = CSD ~ "sfx\se_plst00.wav";
- @Initialize{
- SetLife(10);
- LoadGraphic(imgFam);
- LoadSE(shot0);
- maintask;
- }
- @MainLoop{
- yield;
- }
- @DrawLoop{
- SetTexture(imgFam);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicRect(0,0,48,48);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,spin);
- if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD){ SetGraphicRect(0,48,48,96);}
- else{ SetGraphicRect(0,0,48,48);}
- DrawGraphic(GetX,GetY);
- spin+=10;
- }
- @Finalize{
- DeleteGraphic(imgFam);
- DeleteSE(shot0);
- }
- task maintask{
- yield;
- fire;
- movement;
- }
- task fire{
- let dir = rand(0,359);
- loop{
- CreateShot01(GetX,GetY,1,dir,RED01,10);
- // PlaySE(shot0);
- dir+=30;
- wait(5);
- }
- }
- //moves the familiar past the player
- task movement{
- SetAngle(GetAngleToPlayer+FamAngle);
- SetSpeed(6);
- }
- function wait(w){ loop(w){ yield;}}
- }
Advertisement
Add Comment
Please, Sign In to add comment