extends SpriteChar; function onUpdate() { //********************右用******************************************* if ($map.getAt(x+5,y)==$pat_dan+0) w=1; //通常の地面 else if ($map.getAt(x+5,y)==$pat_dan+22) w=1; //川にかかっている橋 else if ($map.getAt(x+5,y)==$pat_dan+41) w=1; //出口の光1 else if ($map.getAt(x+5,y)==$pat_dan+14) w=1; //出口の光2 else if ($map.getAt(x+5,y)==$pat_dan+15) w=1; //出口の光3 else if ($map.getAt(x+5,y)==$pat_dan+16) w=1; //出口の光4 else if ($map.getAt(x+5,y)==$pat_dan+159) w=1; //壁の最下段 else if ($map.getAt(x+5,y)==$pat_dan+160) w=1; //壁の最下段2 else if ($map.getAt(x+5,y)==$pat_dan+161) w=1; //壁の最下段3 else if ($map.getAt(x+5,y)==$pat_dan+84) w=1; //壁の最下段 else if ($map.getAt(x+5,y)==$pat_dan+85) w=1; //壁の最下段2 else if ($map.getAt(x+5,y)==$pat_dan+86) w=1; //壁の最下段3 else if ($map.getAt(x+5,y)==$pat_dan+50) w=1; //階段 else if ($map.getAt(x+5,y)==$pat_dan+24) w=1; //階段2 else if ($map.getAt(x+5,y)==$pat_dan+45) w=1; //白い穴 else if ($map.getAt(x+5,y)==$pat_dan+46) w=1; //黒い穴 else if ($map.getAt(x+5,y)==$pat_dan+178) w=1; //ライト else if ($map.getAt(x+5,y)==$pat_dan+179) w=1; //ライト else if ($map.getAt(x+5,y)==$pat_dan+162) w=1; //黒い穴のわき else if ($map.getAt(x+5,y)==$pat_dan+164) w=1; //黒い穴のわき2 else if ($map.getAt(x+5,y)==$pat_dan+165) w=1; //白い穴のわき else if ($map.getAt(x+5,y)==$pat_dan+167) w=1; //白い穴のわき2 else if ($map.getAt(x+5,y)==$pat_dan+34) w=1; //ワープゾーン else if ($map.getAt(x+5,y)==$pat_dan+1) w=1; //小石 else if ($map.getAt(x+5,y)==$pat_dan+26) w=1; //小石2 else if ($map.getAt(x+5,y)==$pat_dan+27) w=1; //小石3 else w=0; //********************左用***************************************** if ($map.getAt(x-5,y)==$pat_dan+0) ww=1; //通常の地面 else if ($map.getAt(x-5,y)==$pat_dan+22) ww=1; //川にかかっている橋 else if ($map.getAt(x-5,y)==$pat_dan+41) ww=1; //出口の光1 else if ($map.getAt(x-5,y)==$pat_dan+14) ww=1; //出口の光2 else if ($map.getAt(x-5,y)==$pat_dan+15) ww=1; //出口の光3 else if ($map.getAt(x-5,y)==$pat_dan+16) ww=1; //出口の光4 else if ($map.getAt(x-5,y)==$pat_dan+159) ww=1; //壁の最下段 else if ($map.getAt(x-5,y)==$pat_dan+160) ww=1; //壁の最下段2 else if ($map.getAt(x-5,y)==$pat_dan+161) ww=1; //壁の最下段3 else if ($map.getAt(x-5,y)==$pat_dan+84) ww=1; //壁の最下段 else if ($map.getAt(x-5,y)==$pat_dan+85) ww=1; //壁の最下段2 else if ($map.getAt(x-5,y)==$pat_dan+86) ww=1; //壁の最下段3 else if ($map.getAt(x-5,y)==$pat_dan+50) ww=1; //階段 else if ($map.getAt(x-5,y)==$pat_dan+24) ww=1; //階段2 else if ($map.getAt(x-5,y)==$pat_dan+45) ww=1; //白い穴 else if ($map.getAt(x-5,y)==$pat_dan+46) ww=1; //黒い穴 else if ($map.getAt(x-5,y)==$pat_dan+178) ww=1; //ライト else if ($map.getAt(x-5,y)==$pat_dan+179) ww=1; //ライト else if ($map.getAt(x-5,y)==$pat_dan+162) ww=1; //黒い穴のわき else if ($map.getAt(x-5,y)==$pat_dan+164) ww=1; //黒い穴のわき2 else if ($map.getAt(x-5,y)==$pat_dan+165) ww=1; //白い穴のわき else if ($map.getAt(x-5,y)==$pat_dan+167) ww=1; //白い穴のわき2 else if ($map.getAt(x-5,y)==$pat_dan+34) ww=1; //ワープゾーン else if ($map.getAt(x-5,y)==$pat_dan+1) ww=1; //小石 else if ($map.getAt(x-5,y)==$pat_dan+26) ww=1; //小石2 else if ($map.getAt(x-5,y)==$pat_dan+27) ww=1; //小石3 else ww=0; //*******************下用************************************** if ($map.getAt(x,y+5)==$pat_dan+0) www=1; //通常の地面 else if ($map.getAt(x,y+5)==$pat_dan+22) www=1; //川にかかっている橋 else if ($map.getAt(x,y+5)==$pat_dan+41) www=1; //出口の光1 else if ($map.getAt(x,y+5)==$pat_dan+14) www=1; //出口の光2 else if ($map.getAt(x,y+5)==$pat_dan+15) www=1; //出口の光3 else if ($map.getAt(x,y+5)==$pat_dan+16) www=1; //出口の光4 else if ($map.getAt(x,y+5)==$pat_dan+159) www=1; //壁の最下段 else if ($map.getAt(x,y+5)==$pat_dan+160) www=1; //壁の最下段2 else if ($map.getAt(x,y+5)==$pat_dan+161) www=1; //壁の最下段3 else if ($map.getAt(x,y+5)==$pat_dan+84) www=1; //壁の最下段 else if ($map.getAt(x,y+5)==$pat_dan+85) www=1; //壁の最下段2 else if ($map.getAt(x,y+5)==$pat_dan+86) www=1; //壁の最下段3 else if ($map.getAt(x,y+5)==$pat_dan+50) www=1; //階段 else if ($map.getAt(x,y+5)==$pat_dan+24) www=1; //階段2 else if ($map.getAt(x,y+5)==$pat_dan+45) www=1; //白い穴 else if ($map.getAt(x,y+5)==$pat_dan+46) www=1; //黒い穴 else if ($map.getAt(x,y+5)==$pat_dan+178) www=1; //ライト else if ($map.getAt(x,y+5)==$pat_dan+179) www=1; //ライト else if ($map.getAt(x,y+5)==$pat_dan+162) www=1; //黒い穴のわき else if ($map.getAt(x,y+5)==$pat_dan+164) www=1; //黒い穴のわき2 else if ($map.getAt(x,y+5)==$pat_dan+165) www=1; //白い穴のわき else if ($map.getAt(x,y+5)==$pat_dan+167) www=1; //白い穴のわき2 else if ($map.getAt(x,y+5)==$pat_dan+34) www=1; //ワープゾーン else if ($map.getAt(x,y+5)==$pat_dan+1) www=1; //小石 else if ($map.getAt(x,y+5)==$pat_dan+26) www=1; //小石2 else if ($map.getAt(x,y+5)==$pat_dan+27) www=1; //小石3 else www=0; //*************************上用************************************** if ($map.getAt(x,y-5)==$pat_dan+0) wwww=1; //通常の地面 else if ($map.getAt(x,y-5)==$pat_dan+22) wwww=1; //川にかかっている橋 else if ($map.getAt(x,y-5)==$pat_dan+41) wwww=1; //出口の光1 else if ($map.getAt(x,y-5)==$pat_dan+14) wwww=1; //出口の光2 else if ($map.getAt(x,y-5)==$pat_dan+15) wwww=1; //出口の光3 else if ($map.getAt(x,y-5)==$pat_dan+16) wwww=1; //出口の光4 else if ($map.getAt(x,y-5)==$pat_dan+159) wwww=1; //壁の最下段 else if ($map.getAt(x,y-5)==$pat_dan+160) wwww=1; //壁の最下段2 else if ($map.getAt(x,y-5)==$pat_dan+161) wwww=1; //壁の最下段3 else if ($map.getAt(x,y-5)==$pat_dan+84) wwww=1; //壁の最下段 else if ($map.getAt(x,y-5)==$pat_dan+85) wwww=1; //壁の最下段2 else if ($map.getAt(x,y-5)==$pat_dan+86) wwww=1; //壁の最下段3 else if ($map.getAt(x,y-5)==$pat_dan+50) wwww=1; //階段 else if ($map.getAt(x,y-5)==$pat_dan+24) wwww=1; //階段2 else if ($map.getAt(x,y-5)==$pat_dan+45) wwww=1; //白い穴 else if ($map.getAt(x,y-5)==$pat_dan+46) wwww=1; //黒い穴 else if ($map.getAt(x,y-5)==$pat_dan+178) wwww=1; //ライト else if ($map.getAt(x,y-5)==$pat_dan+179) wwww=1; //ライト else if ($map.getAt(x,y-5)==$pat_dan+162) wwww=1; //黒い穴のわき else if ($map.getAt(x,y-5)==$pat_dan+164) wwww=1; //黒い穴のわき2 else if ($map.getAt(x,y-5)==$pat_dan+165) wwww=1; //白い穴のわき else if ($map.getAt(x,y-5)==$pat_dan+167) wwww=1; //白い穴のわき2 else if ($map.getAt(x,y-5)==$pat_dan+34) wwww=1; //ワープゾーン else if ($map.getAt(x,y-5)==$pat_dan+1) wwww=1; //小石 else if ($map.getAt(x,y-5)==$pat_dan+26) wwww=1; //小石2 else if ($map.getAt(x,y-5)==$pat_dan+27) wwww=1; //小石3 else wwww=0; } anim=newAnimation(); //アニメーション用関数 $screenWidth=350; $screenHeight=350; w=1; //右 ww=1; //左 www=1; //下 wwww=1; //上 life=10; //ライフ menu=0; //メニュー表示 setFont ("MS ゴシック",1,1); while(1) { //*********移動関係********************* anim.pause(); $map.scrollTo(x-$screenWidth/2,y-$screenHeight/2); if (getkey(39)>0 && w==1) { //右 x+=2;anim.loop($pat_char+3,$pat_char+5,5); } else if (getkey(37)>0 && ww==1) { //左 x-=2;anim.loop($pat_char+9,$pat_char+11,5); } else if (getkey(40)>0 && www==1) { //下 y+=2;anim.loop($pat_char+6,$pat_char+8,5); } else if (getkey(38)>0 && wwww==1) { //上 y-=2;anim.loop($pat_char+0,$pat_char+2,5); } //*********所持品表示******************** menu=0; yyy=10; if (getkey(32)==1) menu=1; while(menu==1) { drawDxSprite(x,y,$pat_4+0,0,-100000,0,255,2.8); //************************************************************************* if (yyy==10) drawText($viewX+20,$viewY+30,"スターテス",$clRed,13,-200000); else drawText($viewX+20,$viewY+30,"スターテス",$clWhite,10,-200000); //************************************************************************* if (yyy==20) drawText($viewX+20,$viewY+50,"セーブ",$clRed,13,-200000); else drawText($viewX+20,$viewY+50,"セーブ",$clWhite,10,-200000); //************************************************************************ if (yyy==30) drawText($viewX+20,$viewY+70,"ロード",$clRed,13,-200000); else drawText($viewX+20,$viewY+70,"ロード",$clWhite,10,-200000); //************************************************************************ if (yyy==40) drawText($viewX+20,$viewY+90,"閉じる",$clRed,13,-200000); else drawText($viewX+20,$viewY+90,"閉じる",$clWhite,10,-200000); //************************************************************************ if (yyy==50) drawText($viewX+20,$viewY+110,"ゲーム終了",$clRed,13,-200000); else drawText($viewX+20,$viewY+110,"ゲーム終了",$clWhite,10,-200000); //************************************************************************ if (getkey(38)==1){ if(yyy==10)yyy=60;//上に飛び出たら最下に移動 60は([メニューの数]+1)*10です。下も同じ。 yyy-=10; //上 } if (getkey(40)==1){ if(yyy==50)yyy=0;//下に飛び出たら最上に移動 yyy+=10; //下 } update(); } update(); }