Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu
- #Title[Sprite Animation Test]
- #Text[Why u no work?!]
- #Player[FREE]
- #ScriptVersion[2]
- #BGM[.\system\0_4.mp3]
- script_enemy_main{
- let CSD = GetCurrentScriptDirectory;
- #include_function ".\AnimationLib.dnh";
- let spriteKoishi = CSD ~ ".\bosskoishi.png";
- @Initialize{
- SetLife(10000);
- SetPlayerInvincibility(1000000);
- SetTimer(70);
- SetScore(100000000);
- SetMovePosition01(GetCenterX,GetCenterY,3);
- LoadGraphic(spriteKoishi);
- CreateAnimation("koishi", "idle", 4);
- SetAnimationFrame("koishi", "idle", 0, spriteKoishi, 12, 0, 0, 64, 64);
- SetAnimationFrame("koishi", "idle", 1, spriteKoishi, 12, 64, 0, 128, 64);
- SetAnimationFrame("koishi", "idle", 2, spriteKoishi, 12, 128, 0, 192, 64);
- SetAnimationFrame("koishi", "idle", 3, spriteKoishi, 12, 192, 0, 256, 64);
- CreateAnimation("koishi", "shoot", 4);
- SetAnimationFrame("koishi", "shoot", 0, spriteKoishi, 4, 0, 128, 64, 192);
- SetAnimationFrame("koishi", "shoot", 1, spriteKoishi, 4, 64, 128, 128, 192);
- SetAnimationFrame("koishi", "shoot", 2, spriteKoishi, 4, 128, 128, 192, 192);
- SetAnimationFrame("koishi", "shoot", 3, spriteKoishi, 4, 192, 128, 256, 192);
- CreateAnimation("koishi", "move left", 4);
- SetAnimationFrame("koishi", "move left", 0, spriteKoishi, 12, 0, 64, 64, 128);
- SetAnimationFrame("koishi", "move left", 1, spriteKoishi, 12, 64, 64, 128, 128);
- SetAnimationFrame("koishi", "move left", 2, spriteKoishi, 12, 128, 64, 192, 128);
- SetAnimationFrame("koishi", "move left", 3, spriteKoishi, 12, 192, 64, 256, 128);
- Animate("koishi", "idle", true);
- mainTask;
- }
- @MainLoop{
- SetCollisionA(GetX,GetY,32);
- SetCollisionB(GetX,GetY,24);
- yield;
- }
- @DrawLoop{
- SetTexture(spriteKoishi);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,0);
- DrawAnimatedSprite("koishi",GetX,GetY);
- }
- @Background{
- }
- @Finalize{
- DeleteGraphic(spriteKoishi);
- }
- task mainTask{
- yield;
- wait(120);
- fire1;
- movement;
- }
- task fire1{
- loop{
- wait(120);
- Animate("koishi", "shoot", false);
- CreateShot01(GetX,GetY,2,GetAngleToPlayer,RED01,0);
- wait(60);
- Animate("koishi", "idle", true);
- yield;
- }
- }
- task movement{
- loop{
- Animate("koishi", "move left", false);
- SetMovePosition01(GetCenterX-100, GetCenterY, 3);
- Animate("koishi", "move left", false);
- SetGraphicAngle(180, 0, 0);
- SetMovePosition01(GetCenterX+100, GetCenterY, 3);
- yield;
- }
- }
- function wait(w){
- loop(w){yield;}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment