Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu[Player]
- #Menu[Neko type]
- #Text[Being Neguka is suffering...]
- #ReplayName[LeNekz]
- #Image[.\NekoSelect.png]
- #ScriptVersion[2]
- script_player_main {
- let CSD = GetCurrentScriptDirectory;
- let nekotex = CSD ~"NekoPlayer.png";
- let nekolife = CSD ~"NekoLife.png";
- let f = 0;
- let f2 = 0;
- let count = -1;
- @Initialize {
- SetSpeed(5,2);
- SetPlayerLifeImage(nekolife,0,0,42,50);
- LoadGraphic(nekolife);
- LoadGraphic(nekotex);
- LoadPlayerShotData(CSD ~ "NekoBullet.txt");
- }
- @DrawLoop {
- // Neko
- SetTexture(nekotex);
- SetAlpha(255);
- SetGraphicScale(1,1);
- if (GetKeyState(VK_LEFT)==KEY_PUSH || GetKeyState(VK_LEFT)==KEY_HOLD){
- SetGraphicAngle(0,0,0);
- if(f2<5) { SetGraphicRect(0,0,19,39); }
- if(f2>=5 && f2<10) { SetGraphicRect(20,0,39,39); }
- if(f2>=10 && f2<15) { SetGraphicRect(40,0,59,39); }
- if(f2>=15 && f2<20) { SetGraphicRect(60,0,79,39); }
- if(f2>=20 && f2<25) { SetGraphicRect(80,0,99,39); }
- if(f2>=25 && f2<30) { SetGraphicRect(100,0,119,39); }
- if(f2>=30 && f2<35) { SetGraphicRect(120,0,139,39); }
- if(f2>=35 && f2<40) { SetGraphicRect(140,0,159,39); }
- if(f2>=40 && f2<45) { SetGraphicRect(0,40,19,79); }
- if(f2>=45 && f2<50) { SetGraphicRect(20,40,39,79); }
- if(f2>=50 && f2<55) { SetGraphicRect(40,40,59,79); }
- if(f2>=55 && f2<60) { SetGraphicRect(60,40,79,79); }
- if(f2>=60 && f2<65) { SetGraphicRect(80,40,99,79); }
- if(f2>=65 && f2<70) { SetGraphicRect(100,40,119,79); }
- if(f2>=70 && f2<75) { SetGraphicRect(120,40,139,79); }
- if(f2>=75 && f2<80) { SetGraphicRect(140,40,159,79); }
- if(f2>=80 && f2<85) { SetGraphicRect(0,80,19,119); }
- if(f2>=85 && f2<90) { SetGraphicRect(20,80,39,119); }
- if(f2>=90 && f2<110) { SetGraphicRect(40,80,59,119); }
- if(f2>=110 && f2<115) { SetGraphicRect(120,80,139,119); }
- if(f2>=115 && f2<120) { SetGraphicRect(140,80,159,119); }
- f2++;
- if(f2==120) {f2=0;}
- }
- else if (GetKeyState(VK_RIGHT)==KEY_PUSH || GetKeyState(VK_RIGHT)==KEY_HOLD){
- SetGraphicAngle(180,0,0);
- if(f2<5) { SetGraphicRect(0,0,19,39); }
- if(f2>=5 && f2<10) { SetGraphicRect(20,0,39,39); }
- if(f2>=10 && f2<15) { SetGraphicRect(40,0,59,39); }
- if(f2>=15 && f2<20) { SetGraphicRect(60,0,79,39); }
- if(f2>=20 && f2<25) { SetGraphicRect(80,0,99,39); }
- if(f2>=25 && f2<30) { SetGraphicRect(100,0,119,39); }
- if(f2>=30 && f2<35) { SetGraphicRect(120,0,139,39); }
- if(f2>=35 && f2<40) { SetGraphicRect(140,0,159,39); }
- if(f2>=40 && f2<45) { SetGraphicRect(0,40,19,79); }
- if(f2>=45 && f2<50) { SetGraphicRect(20,40,39,79); }
- if(f2>=50 && f2<55) { SetGraphicRect(40,40,59,79); }
- if(f2>=55 && f2<60) { SetGraphicRect(60,40,79,79); }
- if(f2>=60 && f2<65) { SetGraphicRect(80,40,99,79); }
- if(f2>=65 && f2<70) { SetGraphicRect(100,40,119,79); }
- if(f2>=70 && f2<75) { SetGraphicRect(120,40,139,79); }
- if(f2>=75 && f2<80) { SetGraphicRect(140,40,159,79); }
- if(f2>=80 && f2<85) { SetGraphicRect(0,60,39,119); }
- if(f2>=80 && f2<85) { SetGraphicRect(0,80,19,119); }
- if(f2>=85 && f2<90) { SetGraphicRect(20,80,39,119); }
- if(f2>=90 && f2<110) { SetGraphicRect(40,80,59,119); }
- if(f2>=110 && f2<115) { SetGraphicRect(120,80,139,119); }
- if(f2>=115 && f2<120) { SetGraphicRect(140,80,159,119); }
- f2++;
- if(f2==120) {f2=0;}
- }
- else {
- if(f<15) { SetGraphicRect(0,0,19,39); }
- if(f>=15 && f<30) { SetGraphicRect(20,0,39,39); }
- if(f>=30 && f<45) { SetGraphicRect(40,0,59,39); }
- if(f>=45 && f<60) { SetGraphicRect(60,0,79,39); }
- if(f>=60 && f<75) { SetGraphicRect(80,0,99,39); }
- if(f>=75 && f<90) { SetGraphicRect(100,0,119,39); }
- if(f>=90 && f<105) { SetGraphicRect(120,0,139,39); }
- if(f>=105 && f<120) { SetGraphicRect(140,0,159,39); }
- if(f>=120 && f<135) { SetGraphicRect(0,40,19,79); }
- if(f>=135 && f<150) { SetGraphicRect(20,40,39,79); }
- if(f>=150 && f<165) { SetGraphicRect(40,40,59,79); }
- if(f>=165 && f<180) { SetGraphicRect(60,40,79,79); }
- if(f>=180 && f<195) { SetGraphicRect(80,40,99,79); }
- if(f>=195 && f<210) { SetGraphicRect(100,40,119,79); }
- if(f>=210 && f<225) { SetGraphicRect(120,40,139,79); }
- if(f>=225 && f<240) { SetGraphicRect(140,40,159,79); }
- if(f>=240 && f<255) { SetGraphicRect(0,80,19,119); }
- if(f>=255 && f<270) { SetGraphicRect(20,80,39,119); }
- if(f2>=270 && f2<300) { SetGraphicRect(40,80,59,119); }
- if(f2>=300 && f2<315) { SetGraphicRect(120,80,139,119); }
- if(f>=315 && f<330) { SetGraphicRect(140,80,159,119); }
- f++;
- }
- DrawGraphic(GetPlayerX, GetPlayerY);
- f+=3;
- f2+=3;
- if(f>=330) { f= 0; }
- }
- @Missed {
- yield;
- }
- @SpellCard {
- }
- @Finalize {
- }
- @MainLoop {
- //When Z is pressed count set to 0
- if((GetKeyState(VK_SHOT)==KEY_PUSH || GetKeyState(VK_SHOT)==KEY_HOLD) && count == -1) {
- count = 0;
- }
- //When Slow
- if (GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD) {
- if(count ==5) {
- yield;
- goodshot(GetPlayerX, GetPlayerY, 15, 270, 1, 5);
- goodshot(GetPlayerX, GetPlayerY, 15, 250, 1, 5);
- goodshot(GetPlayerX, GetPlayerY, 15, 290, 1, 5);
- PlaySE(CSD ~ "ShotSFX.wav");
- count = -1;
- }
- }
- //When Regular
- else {
- if(count ==5) {
- yield;
- goodshot(GetPlayerX, GetPlayerY, 15, 270, 1, 5);
- PlaySE(CSD ~ "ShotSFX.wav");
- count = -1;
- }
- }
- //if count is 0 or greater, start counting for each frame
- if (count >=0) {
- count++;
- }
- SetIntersectionCircle(GetPlayerX, GetPlayerY, 0);
- yield;
- }
- // NekoShot
- task goodshot(x,y,speed,dir,graphic,dmg) {
- let obj = Obj_Create(OBJ_SHOT);
- Obj_SetPosition(obj,x,y);
- Obj_SetSpeed(obj,speed);
- Obj_SetAngle(obj,dir);
- Obj_SetAlpha(obj,155);
- ObjShot_SetGraphic(obj,graphic);
- ObjShot_SetDamage(obj,dmg);
- ObjShot_SetPenetration(obj,1);
- }
- function wait(w) { loop(w) { yield; }
- }
- [---------------this is the bullet code-----------------]
- #playerShotData
- ShotImage =".\kyuubshot.png"
- ShotData { id = 1 rect=(0,0,111,111) render=ALPHA alpha=255}
Advertisement
Add Comment
Please, Sign In to add comment