【IchigoLatte】ゴーストバスター(ゲーム)
隕石避けゲームに少し手を入れたら全く違うものになりましたw
内容は、
・5編隊の炎を追加
・レーザーを撃てる(最大5発まで)
・自分が上下にも移動可能
・アイテム(☆)を取ると敵が全滅、レーザー5発補給
・見た目の変更
・タイトル画面を追加
等
※2KByteに収めるためなるべく空白を減らしています
//----- Ghost Buster var LASER=0xf7; var ITEM1=0xf0; var ENEMY1=0xec,ENEMY2=0xf5; var GHOSTS=5,X=15; var count,score,wait,my; var i,j,k,x,y,char,shot; var str=" Hit Enter Key ... "; function ini() { my=0xf9; y=23; count=0; score=0; wait=200; shot=5; cls(); x=10; lc(x,6); log("Ghost Buster!\n"); x=4; lc(x,9); log("MOVE ...", "LEFT,RIGHT,UP,DOWN\n"); lc(x,10); log("SHOOT...SPACE\n"); lc(x+4,11); log(chr(ITEM1), "...All Flush ITEM !\n"); x=8; lc(x,14); log(str); input(); cls(); } function key(kc) { k=kc; } function ghost() { count=count+1; if(count%10==0){ lc(rnd(31),0); log(chr(ENEMY1)); } if(count%100==0){ i=0; x=rnd(31-GHOSTS); while(i<GHOSTS){ lc(x+i,0); log(chr(ENEMY2)); i=i+1; } } if(count%300==0){ x=rnd(31-3); i=0; while(i<3){ j=0; while(j<3){ lc(x+j,i); log(chr(ITEM1)); j=j+1; } i=i+1; } } } function shoot() { i=0; i=0; while(i<10){ lc(X,y-i-1); log(chr(LASER)); i=i+1; sleep(10); } i=0; while(i<10){ lc(X,y-i-1); log(chr(0x00)); i=i+1; sleep(10); } shot=shot-1; } function move() { lc(X,y); log(chr(0x00)); scroll(2,1); if(k==0x1c){ my=0xfd; scroll(1,1); } if(k==0x1d){ my=0xfb; scroll(3,1); } char=scr(X,y); if((k==0x1e)*(y>11)){ my=0xf9; y=y-1; } if((k==0x1f)*(y<23)){ my=0xfa; y=y+1; } k=0; lc(X,y); log(chr(my)); } function check() { if(char==ITEM1){ cls(); lc(11,13); log("FLASH !!!\n"); sleep(2000); cls(); shot=5; return; } if(char){ x=10; lc(x,13); log(" GAME OVER "); lc(x,14); log(" ",score," points "); x=8; lc(x,16); log(str); input(); ini(); setTout(main,wait); } } function main() { score=score+1; ghost(); if((k==0x20)*(shot>0)){ shoot(); } move(); check(); if(wait>30){ wait=wait-1; } setTout(main,wait); } setKprs(key); ini(); main();