Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu[Single]
- #Title[...]
- #Text[...]
- #Player[MARISA]
- #ScriptVersion[2]
- script_enemy_main{
- let D = GetCurrentScriptDirectory;
- let imgBoss = D ~ "system\touhouchar1.png";
- let cut = D ~ "system\touhouchar2.png";
- let bg = D ~ "system\trees.png";
- let effect = D ~ "system\thing.png";
- @Initialize{
- SetLife(2500);
- SetTimer(60);
- SetScore(100000);
- LoadGraphic(imgBoss);
- LoadGraphic(cut);
- LoadGraphic(bg);
- LoadGraphic(effect);
- SetMovePosition02(GetCenterX, GetCenterY-96, 0);
- CutIn(YOUMU,"...",cut,0,0,360,290);
- mainTask;
- }
- @MainLoop{
- SetCollisionA(GetX,GetY,32);
- SetCollisionB(GetX,GetY,16);
- yield;
- }
- @DrawLoop{
- SetTexture(imgBoss);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicRect(0,0,110,110);
- SetGraphicScale(0.7,0.7);
- SetGraphicAngle(0,0,0);
- DrawGraphic(GetX,GetY);
- }
- @BackGround{
- SetTexture(bg);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicRect(0,0,600,690);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,0);
- DrawGraphic(GetCenterX,GetCenterY);
- }
- @Finalize{
- DeleteGraphic(imgBoss);
- DeleteGraphic(cut);
- DeleteGraphic(bg);
- DeleteGraphic(effect);
- }
- task mainTask{
- fire;
- effect;
- }
- task fire{
- loop{
- let obj=Obj_Create(OBJ_SHOT);
- Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
- Obj_SetAngle(obj, GetAngleToPlayer);
- Obj_SetSpeed(obj, 2);
- ObjShot_SetGraphic(obj, WHITE03);
- ObjShot_SetDelay(obj, 0);
- ObjShot_SetBombResist(obj, true);
- wait(45);
- yield;
- }
- }
- task effect{
- let obj=Obj_Create(OBJ_EFFECT);
- let counter = 0;
- ObjEffect_SetRenderState(obj,ALPHA);
- ObjEffect_SetTexture(obj,effect);
- Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
- ObjEffect_SetScale(obj,1,1);
- ObjEffect_SetLayer(obj,5);
- ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
- ObjEffect_CreateVertex(obj,4);
- ObjEffect_SetVertexXY(obj, 0, -45, -44);
- ObjEffect_SetVertexXY(obj, 1, 45, -44);
- ObjEffect_SetVertexXY(obj, 2, -45, 44);
- ObjEffect_SetVertexXY(obj, 3, 45, 44);
- ObjEffect_SetVertexUV(obj, 0, 0, 0);
- ObjEffect_SetVertexUV(obj, 1, 90, 0);
- ObjEffect_SetVertexUV(obj, 2, 0, 88);
- ObjEffect_SetVertexUV(obj, 3, 90, 88);
- while(!Obj_BeDeleted(obj)) {
- if(counter==120){ Obj_Delete(obj); }
- counter++;
- yield;
- }
- }
- function wait(w){loop(w){yield;}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment