#define TipSizeX 16 ; チップのXサイズ
#define TipSizeY 16 ; チップのYサイズ #define JampSp 10 ; ジャンプの初期速度 #define Gravity 1 ; 重力加速度 #define MoveX 5 ; 横移動量 #define ScreenX TipSizeX*20*2 ; スクリーンのXサイズ #define ScreenY TipSizeY*10 ; スクリーンのYサイズ #define OverScrRight 60 ; 右60%スクロール #define OverScrLeft 40 ; 左40%スクロール #define OverScrTop 40 ; 上40%スクロール #define OverScrBack 60 ; 下60%スクロール #define ScrCtrl 1 ; スクロールの止めなど /*ゲームオーバー描写のためのバッファ*/ buffer 4 color : boxf /*マップチップ描写のバッファ*/ buffer 2 //picload "tip2.bmp" ; マップチップ画像描写 //全て透明色に color:boxf //普通の床は黒 color 1 , 1 , 1 boxf 1 * TipSizeX , 0 * TipSizeY , 1 * TipSizeX + TipSizeX-1 , 0 * TipSizeY + TipSizeY-1 boxf 2 * TipSizeX , 0 * TipSizeY , 2 * TipSizeX + TipSizeX-1 , 0 * TipSizeY + TipSizeY-1 boxf 3 * TipSizeX , 0 * TipSizeY , 3 * TipSizeX + TipSizeX-1 , 0 * TipSizeY + TipSizeY-1 //消える床は緑 color 0 , 200 , 0 boxf 0 * TipSizeX , 2 * TipSizeY , 0 * TipSizeX + TipSizeX-1 , 2 * TipSizeY + TipSizeY-1 boxf 2 * TipSizeX , 2 * TipSizeY , 2 * TipSizeX + TipSizeX-1 , 2 * TipSizeY + TipSizeY-1 //透ける床は青 color 0 , 0 , 200 boxf 3 * TipSizeX , 2 * TipSizeY , 3 * TipSizeX + TipSizeX-1 , 2 * TipSizeY + TipSizeY-1 boxf 4 * TipSizeX , 2 * TipSizeY , 4 * TipSizeX + TipSizeX-1 , 2 * TipSizeY + TipSizeY-1 //炎は黄色 color 200 , 200 , 0 boxf 0 * TipSizeX , 3 * TipSizeY , 0 * TipSizeX + TipSizeX-1 , 3 * TipSizeY + TipSizeY-1 boxf 1 * TipSizeX , 3 * TipSizeY , 1 * TipSizeX + TipSizeX-1 , 3 * TipSizeY + TipSizeY-1 boxf 2 * TipSizeX , 3 * TipSizeY , 2 * TipSizeX + TipSizeX-1 , 3 * TipSizeY + TipSizeY-1 boxf 0 * TipSizeX , 4 * TipSizeY , 0 * TipSizeX + TipSizeX-1 , 4 * TipSizeY + TipSizeY-1 boxf 1 * TipSizeX , 4 * TipSizeY , 1 * TipSizeX + TipSizeX-1 , 4 * TipSizeY + TipSizeY-1 boxf 2 * TipSizeX , 4 * TipSizeY , 2 * TipSizeX + TipSizeX-1 , 4 * TipSizeY + TipSizeY-1 //ワープのドアは水色 color 0 , 200 , 200 boxf 4 * TipSizeX , 0 * TipSizeY , 4 * TipSizeX + TipSizeX-1 , 0 * TipSizeY + TipSizeY-1 boxf 4 * TipSizeX , 1 * TipSizeY , 4 * TipSizeX + TipSizeX-1 , 1 * TipSizeY + TipSizeY-1 //終わりのドアは紫 color 200 , 0 , 200 boxf 3 * TipSizeX , 3 * TipSizeY , 3 * TipSizeX + TipSizeX-1 , 3 * TipSizeY + TipSizeY-1 boxf 4 * TipSizeX , 3 * TipSizeY , 4 * TipSizeX + TipSizeX-1 , 3 * TipSizeY + TipSizeY-1 boxf 3 * TipSizeX , 4 * TipSizeY , 3 * TipSizeX + TipSizeX-1 , 4 * TipSizeY + TipSizeY-1 boxf 4 * TipSizeX , 4 * TipSizeY , 4 * TipSizeX + TipSizeX-1 , 4 * TipSizeY + TipSizeY-1 boxf 3 * TipSizeX , 5 * TipSizeY , 3 * TipSizeX + TipSizeX-1 , 5 * TipSizeY + TipSizeY-1 boxf 4 * TipSizeX , 5 * TipSizeY , 4 * TipSizeX + TipSizeX-1 , 5 * TipSizeY + TipSizeY-1 screen 0 , ScreenX , ScreenY sdim map , 5000 sdim mapget , 100 dim ax , 2000 dim ay , 2000 dim FloorX , 1000 dim FloorY , 1000 dim WhatKind , 1000 ; 床の種類 dim FaitFlag , 500 ; 消えるに触れているか触れていないか dim FaitCnt , 500 ; 触れてからの時間(フレーム数) dim Faitnumber , 500 ; その消える床は何番目の床か?(ほかの床も含む) dim Fait , 500 ; 1になると消える dim FaitEfect , 500 ; 1になるとエフェクト dim WorpX , 20 ; ワープドアのX座標 dim WorpY , 20 ; ワープドアのY座標 dim Worp , 20 ; ワープのための???(説明しづらい) /*マップデータ読み込み*/ notesel map //noteload "map1.txt" map= "B A "+"\n" map+=" 111 22222 22 "+"\n" map+=" 11111 22 33 2222 "+"\n" map+=" 33 33 2222 "+"\n" map+=" 1 11 11 33 33 111 "+"\n" map+="G 3333 11 33 "+"\n" map+=" 0 0 55555 88888 "+"\n" map+=" 00 Z 0 "+"\n" map+=" M 0 0000 777777 7 77 "+"\n" map+="0000000000000000000000000000000000000000000000000000000000000000000000 000"+"\n" map+=" 00 "+"\n" map+=" 00 "+"\n" map+=" D 00 "+"\n" map+=" 00 "+"\n" map+=" 00 "+"\n" map+=" C 00 "+"\n" map+=" 00 "+"\n" map+=" 111111111 00 D H "+"\n" map+=" 00 "+"\n" map+=" 3333333333333333333033003333333333333333333333333333333333333 "+"\n" map+=" 888 8 88888888888888888888888888888888888888 "+"\n" map+=" "+"\n" map+=" 8888000880008888"+"\n" map+=" 0A "+"\n" map+=" 0000000 7777 7777 333 0 B"+"\n" map+=" 0HC 0 55555555555555 8 8 8 0 7 7 "+"\n" map+=" 0 00 E F0000000000000000"+"\n" map+=" 0 0 77777777777777777770000777000077700077 "+"\n" map+="00000003333300000000000000000000000000000000000000000000000000000000000000000000"+"\n" map+=" 0 0 0 0 "+"\n" map+=" 0777770 0 E 0 "+"\n" map+=" 0000000 0 G 0 F "+"\n" map+=" 0 0 "+"\n" map+=" N 000000000 0 "+"\n" map+=" 0 "+"\n" map+=" 111111 3 0 "+"\n" map+=" 33 "+"\n" map+=" 33 "+"\n" map+="0 00 00 0 0000 333 "+"\n" noteget mapget ; マップの一行目を取得 /*マップ色々*/ MapX = strlen(mapget) ; マップのXサイズ(マス) MapY = noteinfo(0) ; マップのYサイズ(マス) MapSize = MapX * MapY //====================================// //------------------------------------// //------------メインループ------------// //------------------------------------// //====================================// *MainLoop gosub *MyPositionSarch buffer 3 , MapX * TipSizeX , MapY * TipSizeY ; スクロールさせるため用バッファ gosub *MapDraw ; マップ描写 gsel 0 ; 元の画面に戻す repeat redraw 0 color 255,255,255 boxf MyX = MyX0 MyY = MyY0 ; 仮座標を本座標に変換 gsel 3 gosub *MapChenge gsel 0 gosub *MapCopy gosub *MyActivity gosub *HitCheck if (RePlay = 1) : break if (Gameover = 1) : gosub *Over //消える床を消すときの時間差カウント repeat number2 if (FaitFlag(cnt) = 1) : FaitCnt(cnt)++ if (FaitCnt(cnt) = 10) : FaitEfect(cnt) = 1 if (FaitCnt(cnt) = 13) : Fait(cnt) = 1 gframe = double(gframe) + 0.003 loop redraw 1 await 16 loop dim FaitFlag , 500 dim FaitCnt , 500 dim Faitnumber , 500 dim Fait , 500 dim FaitEfect , 500 Gameover = 0 RePlay = 0 HalfCopy = 0 sp = 0 goto *MainLoop /*マップデータから自分の座標をサーチ*/ *MyPositionSarch repeat MapSize x = cnt \ MapX y = cnt / MapX notesel map noteget mapget , y buf = peek(mapget , x) if (buf = 'M'){ MyX0 = x * TipSizeX MyY0 = y * TipSizeY scx = MyX0 + 16 - ScreenX / 2 scy = MyY0 + 16 - ScreenY / 2 //横スクロール上限、下限で修正 if scx < 0 : scx = 0 if scx > (( MapX * TipSizeX) - ScreenX) : scx = (MapX * TipSizeX) - ScreenX //縦スクロール上限、下限で修正 if scy < 0 : scy = 0 if scy > (( MapY * TipSizeY) - ScreenY) : scy = (MapY * TipSizeY) - ScreenY break } loop return /*マップ描写*/ *MapDraw color 255 , 255 , 255 boxf number = 0 ; 床の数 number2 = 0 ; 消える床の数 number3 = 0 ; 炎の数 number5 = 0 ; ワープドアの数 repeat MapSize x=cnt \ MapX y=cnt / MapX noteget mapget , y buf = peek(mapget , x) //全てのマップチップの座標を取得 ax(cnt) = x * TipSizeX ay(cnt) = y * TipSizeY pos x * TipSizeX , y * TipSizeY gmode 2 switch buf case ' ' gcopy 2,0,0,TipSizeX,TipSizeY swbreak //-------------------- case '0' gcopy 2 , 2 * TipSizeX ,0 * TipSizeY , TipSizeX , TipSizeY //普通の床の座標を取得 FloorX(number) = ax(cnt) FloorY(number) = ay(cnt) WhatKind(number) = 0 number++ swbreak case '1' gcopy 2 , 3 * TipSizeX , 0 * TipSizeY , TipSizeX , TipSizeY //普通の床の座標を取得 FloorX(number) = ax(cnt) FloorY(number) = ay(cnt) WhatKind(number) = 0 number++ swbreak case '2' gcopy 2 , 1 * TipSizeX , 0 * TipSizeY , TipSizeX , TipSizeY //普通の床の座標を取得 FloorX(number) = ax(cnt) FloorY(number) = ay(cnt) WhatKind(number) = 0 number++ swbreak case '3' if (Fait(number2) = 0)and(FaitEfect(number2) = 1) : gcopy 2 , TipSizeX * 1 , TipSizeY * 2 , TipSizeX , TipSizeY if (Fait(number2) = 1) : gcopy 2 , TipSizeX * 0 , TipSizeY * 0 , TipSizeX , TipSizeY if (Fait(number2) = 0)and(FaitEfect(number2) = 0) : gcopy 2 , TipSizeX * 0 , TipSizeY * 2 , TipSizeX , TipSizeY //消える床の座標を取得 FloorX(number) = ax(cnt) FloorY(number) = ay(cnt) if (Fait(number2) = 1) : FloorX(number) = -100 if (Fait(number2) = 1) : FloorY(number) = -100 WhatKind(number) = 1 Faitnumber(number2) = number number++ number2++ swbreak case '4' if (Fait(number2) = 0)and(FaitEfect(number2) = 1) : gcopy 2 , TipSizeX * 1 , TipSizeY * 2 , TipSizeX , TipSizeY if (Fait(number2) = 1) : gcopy 2 , TipSizeX * 0 , TipSizeY * 0 , TipSizeX , TipSizeY if (Fait(number2) = 0)and(FaitEfect(number2) = 0) : gcopy 2 , TipSizeX * 2 , TipSizeY * 2 , TipSizeX , TipSizeY //消える床の座標を取得 FloorX(number) = ax(cnt) FloorY(number) = ay(cnt) if (Fait(number2) = 1) : FloorX(number) = -100 ; 消える床を消す if (Fait(number2) = 1) : FloorY(number) = -100 ; 消える床を消す WhatKind(number) = 1 Faitnumber(number2) = number number++ number2++ swbreak case '5' gcopy 2 , 3 * TipSizeX , 2 * TipSizeY , TipSizeX , TipSizeY //透ける床の座標を取得 FloorX(number) = ax(cnt) FloorY(number) = ay(cnt) WhatKind(number) = 2 number++ swbreak case '6' gcopy 2 , 4 * TipSizeX , 2 * TipSizeY , TipSizeX , TipSizeY //透ける床の座標を取得 FloorX(number) = ax(cnt) FloorY(number) = ay(cnt) WhatKind(number) = 2 number++ swbreak case '7' gcopy 2 , (int(gframe) \ 3) * TipSizeX , 3 * TipSizeY , TipSizeX , TipSizeY //痛い床の座標を取得 FloorX(number) = ax(cnt) FloorY(number) = ay(cnt) FireX(number3) = FloorX(number) FireY(number3) = FloorY(number) EfectKind(number3) = 0 WhatKind(number) = 3 number++ number3++ swbreak case '8' gcopy 2 , (int(gframe) \ 3) * TipSizeX , 4 * TipSizeY , TipSizeX , TipSizeY //痛い床の座標を取得 FloorX(number) = ax(cnt) FloorY(number) = ay(cnt) FireX(number3) = FloorX(number) FireY(number3) = FloorY(number) EfectKind(number3) = 1 WhatKind(number) = 3 number++ number3++ swbreak case 'M' : swbreak case 'N' pos x * TipSizeX-3 , y * TipSizeY-5 gcopy 2 , 3 * TipSizeX , 3 * TipSizeY , TipSizeX+6 , 2*TipSizeY+5 NextDoorX = ax(cnt) NextDoorY = ay(cnt) swbreak case 'Z' gcopy 2 , 4 * TipSizeX , 0 * TipSizeY , TipSizeX , 2*TipSizeY //SPドアの座標を登録 SpDoorX = ax(cnt) SpDoorY = ay(cnt) swbreak default gcopy 2 , 4 * TipSizeX , 0 * TipSizeY , TipSizeX , 2*TipSizeY //ワープドアの座標を登録 number4 = buf - 65 number40 = number4 + Worp(number4) WorpX(number40+number4) = ax(cnt) WorpY(number40+number4) = ay(cnt) Worp(number4) = 1 number5++ swend loop return /*マップのエフェクト*/ *MapChenge repeat number2 color 255,255,255 if (FaitEfect(cnt) = 1) : boxf FloorX(Faitnumber(cnt)) , FloorY(Faitnumber(cnt)) , FloorX(Faitnumber(cnt)) + TipSizeX-1 , FloorY(Faitnumber(cnt)) + TipSizeY-1 pos FloorX(Faitnumber(cnt)) , FloorY(Faitnumber(cnt)) if (Fait(cnt) = 0)and(FaitEfect(cnt) = 1) : gcopy 2 , TipSizeX * 1 , TipSizeY * 2 , TipSizeX , TipSizeY if (Fait(cnt) = 1)and(FaitEfect(cnt) = 1){ gcopy 2 , TipSizeX * 0 , TipSizeY * 0 , TipSizeX , TipSizeY FloorX(Faitnumber(cnt)) = -100 } loop repeat number3 color 255,255,255 boxf FireX(cnt) , FireY(cnt) , FireX(cnt) + TipSizeX-1 , FireY(cnt) + TipSizeY-1 pos FireX(cnt) , FireY(cnt) if (EfectKind(cnt) = 0) : gcopy 2 , (int(gframe) \ 3) * TipSizeX , 3 * TipSizeY , TipSizeX , TipSizeY if (EfectKind(cnt) = 1) : gcopy 2 , (int(gframe) \ 3) * TipSizeX , 4 * TipSizeY , TipSizeX , TipSizeY loop return /*マップをスクロールさせコピー*/ *MapCopy gsel 0 gmode 0,ScreenX,ScreenY pos 0,0 gcopy 3,scx,scy,ScreenX,ScreenY return /*主人公の活動*/ *MyActivity color 200 , 0 , 0 boxf MyX - scx , MyY - scy , MyX - scx + TipSizeX-1 , MyY - scy + TipSizeY-1 if (land = 0){ MyY0 -= sp if ScrCtrl{ if (sp > 0){ if (MyY0 - scy) < (ScreenY * OverScrTop / 100){ ;画面の上にきていたら scy -= sp } } } if ScrCtrl{ if (sp < 0){ if (MyY0 - scy) > (ScreenY * OverScrBack / 100){ ;画面の下にきていたら scy -= sp } } } sp -= Gravity if (sp < -TipSizeY - 4) : sp = -TipSizeY - 4 } //縦スクロール上限、下限で修正 if scy < 0 : scy = 0 if scy > (( MapY * TipSizeY) - ScreenY) : scy = (MapY * TipSizeY) - ScreenY if (Gameover = 0) : stick key , 13 if (Gameover = 1) : key = 0 //画面の下に落ちたら死ぬ判定 if (MyY0 > MapY * TipSizeY) : Gameover = 1 if (key & 1){ //左移動 MyX0 -= MoveX if ScrCtrl{ if (MyX0 - scx) < (ScreenX * OverScrLeft / 100){ ;画面の左にきていたら scx -= MoveX ;マップ位置を調整 } } } if (key & 4){ //右移動 MyX0 += MoveX if ScrCtrl{ if ( MyX0 - scx ) > ( (ScreenX * OverScrRight / 100) - TipSizeX ) { ;画面の右にきていたら scx += MoveX ;マップ位置を調整 } } } if (key & 2){ if (land = 1){ sp = JampSp } } //横スクロール上限、下限で修正 if scx < 0 : scx = 0 if scx > (( MapX * TipSizeX) - ScreenX) : scx = (MapX * TipSizeX) - ScreenX //キャラクタの移動制限 if MyX0 < (scx) : MyX0 = scx //左から食み出ない if MyX0 > (( MapX - 1 ) * TipSizeX) : MyX0 = ( MapX - 1 ) * TipSizeX //右に食み出ない //当たり判定用の座標の変数の作成 MeTop = MyY0 MeLeft = MyX0 MeRight = MyX0 + TipSizeX-1 MeEnd = MyY0 + TipSizeY-1 return /*当たり判定*/ *HitCheck land = 0 frame = 0 FallNot = 0 ; 消える床と同時に普通の床に着陸しているとき消えないようにする変数 DieNot = 0 ; 炎と同時に普通の壁に当たっているとき死なないようにする変数 repeat number //LandNot変数の初期化 LandNot = 0 FX = FloorX(cnt) FY = FloorY(cnt) //四隅の点の情報を取得 MFT = (MeTop / TipSizeY) = (FY / TipSizeY) ;マップと自キャラ位置の上部判定 MFB = (MeEnd / TipSizeY) = (FY / TipSizeY) ;マップと自キャラ位置の下部判定 MFL = (MeLeft / TipSizeX) = (FX / TipSizeX) ;マップと自キャラ位置の左辺判定 MFR = (MeRight / TipSizeX) = (FX / TipSizeX) ;マップと自キャラ位置の右辺判定 DotA= (MFT) and (MFL) DotB= (MFB) and (MFL) DotC= (MFB) and (MFR) DotD= (MFT) and (MFR) Dot = DotA + DotB + DotC + DotD //左に移動中の壁衝突 if (DotA * DotB){ if (WhatKind(cnt) ! 2){ MyX0 = FloorX(cnt) + TipSizeX LandNot = 1 if (WhatKind(cnt) ! 3)and(HalfCopy = 0) : DieNot = 1 : Gameover = 0 if (WhatKind(cnt) = 3)and(DieNot = 0) : Gameover = 1 } } if (MeEnd >= FY) and (MeTop < (FY + TipSizeY - 1 )){ if (Dot = 1)and ((DotA = 1) or (DotB = 1)){ if (MyX > (FX + TipSizeX -1) ){ if (WhatKind(cnt) ! 2){ MyX0 = FX + TipSizeX LandNot = 1 if (WhatKind(cnt) ! 3)and(HalfCopy = 0) : DieNot = 1 : Gameover = 0 if (WhatKind(cnt) = 3)and(DieNot = 0) : Gameover = 1 } } } } //右に移動中の壁衝突 if (DotC * DotD){ if (WhatKind(cnt) ! 2){ MyX0 = FX - TipSizeX LandNot = 1 if (WhatKind(cnt) ! 3)and(HalfCopy = 0) : DieNot = 1 : Gameover = 0 if (WhatKind(cnt) = 3)and(DieNot = 0) : Gameover = 1 } } if (MeEnd >= FY) and (MeTop < (FY + TipSizeY - 1 )){ if (Dot = 1) and ((DotC = 1) or (DotD = 1)){ if ((MyX + TipSizeX-1) < FX){ if (WhatKind(cnt) ! 2){ MyX0 = FX - TipSizeX LandNot = 1 if (WhatKind(cnt) ! 3)and(HalfCopy = 0) : DieNot = 1 : Gameover = 0 if (WhatKind(cnt) = 3)and(DieNot = 0) : Gameover = 1 } } } } //落下中に床に衝突 if (DotB * DotC)*(LandNot = 0){ if (sp < 0){ if (MyY + (TipSizeY-1) < FY){ MyY0 = FY - TipSizeY sp = 0 if (WhatKind(cnt) ! 3)and(HalfCopy = 0) : DieNot = 1 : Gameover = 0 if (WhatKind(cnt) = 3)and(DieNot = 0) : Gameover = 1 } } } if (MeRight > FX) and (MeLeft < FX + TipSizeX-1){ if (Dot =1)and ((DotB = 1) or (DotC = 1)){ if (MyY0 - MyY > 0){ if (MeEnd >= FY){ if (LandNot = 0){ if (MyY + (TipSizeY-1) < FY){ MyY0 = FY - TipSizeY sp = 0 if (WhatKind(cnt) ! 3)and(HalfCopy = 0) : DieNot = 1 : Gameover = 0 if (WhatKind(cnt) = 3)and(DieNot = 0) : Gameover = 1 } } } } } } //着地してるかどうかの判定 if ((Dot = 0)or(DotB = 1)or(DotC = 1)){ if (MeTop = (FY - TipSizeY)){ if (MeRight >= FX){ if (MeLeft <= (FX + TipSizeX - 1 )){ if (LandNot = 0){ if (key & 2){ }else{ land = 1 : sp=0 if (WhatKind(cnt) = 0) : FallNot = 1 if (WhatKind(cnt) = 1)and(FallNot = 0){ repeat number2 if (frame = Faitnumber(cnt)) : FaitFlag(cnt) = 1 loop } } } } } } } //ジャンプ中に天井に衝突 if (DotA = 1) and (DotD = 1){ if (LandNot = 0){ if (WhatKind(cnt) ! 2){ MyY0 = FloorY(cnt) + TipSizeY sp = 0 if (WhatKind(cnt) ! 3)and(HalfCopy = 0) : DieNot = 1 : Gameover = 0 if (WhatKind(cnt) = 3)and(DieNot = 0) : Gameover = 1 } } } if (MeRight > FloorX(cnt)) and (MeLeft < (FloorX(cnt) + (TipSizeX - 1 ))){ if (Dot = 1) and ((DotA = 1) or (DotD = 1)){ if (MyY0 - MyY < 0){ if (MyY > FloorY(cnt) + (TipSizeY - 1 )){ if (LandNot = 0){ if (WhatKind(cnt) ! 2){ MyY0 = FloorY(cnt) + TipSizeY sp = 0 if (WhatKind(cnt) ! 3)and(HalfCopy = 0) : DieNot = 1 : Gameover = 0 if (WhatKind(cnt) = 3)and(DieNot = 0) : Gameover = 1 } } } } } } frame++ loop //ワープ判定 getkey Ky , 'Z' if (LastKy){ if (Ky = 0) : LastKy = 0 Ky = 0 } repeat number5/2 if (MeRight >= WorpX(cnt*2))and(MeLeft <= WorpX(cnt*2) + TipSizeX-1){ if (MeTop = WorpY(cnt*2) + TipSizeY){ if (Ky = 1){ MyX0 = WorpX(cnt*2+1) MyY0 = WorpY(cnt*2+1) + TipSizeY EndDoorX = WorpX(cnt*2) EndDoorY = WorpY(cnt*2) + TipSizeY scx = MyX0 + TipSizeX / 2 - ScreenX / 2 scy = MyY0 + TipSizeY / 2 - ScreenY / 2 if scx < 0 : scx = 0 if scx > (( MapX * TipSizeX) - ScreenX) : scx = (MapX * TipSizeX) - ScreenX if scy < 0 : scy = 0 if scy > (( MapY * TipSizeY) - ScreenY) : scy = (MapY * TipSizeY) - ScreenY LastKy = 1 EndDoorOK = 1 Ky = 0 } } } if (MeRight >= WorpX(cnt*2+1))and(MeLeft <= WorpX(cnt*2+1) + TipSizeX-1){ if (MeTop = WorpY(cnt*2+1) + TipSizeY){ if (Ky = 1){ MyX0 = WorpX(cnt*2) MyY0 = WorpY(cnt*2) + TipSizeY EndDoorX = WorpX(cnt*2+1) EndDoorY = WorpY(cnt*2+1) + TipSizeY scx = MyX0 + TipSizeX / 2 - ScreenX / 2 scy = MyY0 + TipSizeY / 2 - ScreenY / 2 if scx < 0 : scx = 0 if scx > (( MapX * TipSizeX) - ScreenX) : scx = (MapX * TipSizeX) - ScreenX if scy < 0 : scy = 0 if scy > (( MapY * TipSizeY) - ScreenY) : scy = (MapY * TipSizeY) - ScreenY LastKy = 1 ; 押しっぱなしOKをなくす変数 EndDoorOK = 1 ; 一回でもドアから出たらOK(SPドアのための変数) Ky = 0 } } } loop //NEXTドアの判定 if (MeRight >= NextDoorX)and(MeLeft <= NextDoorX + TipSizeX-1){ if (MeTop = NextDoorY + TipSizeY){ if (Ky = 1) : Gameover = 1 } } //SPドアの判定(前回出てきたドアへワープ) if (MeRight >= SpDoorX)and(MeLeft <= SpDoorX + TipSizeX-1){ if (MeTop = SpDoorY + TipSizeY){ if (Ky = 1)and(EndDoorOK){ MyX0 = EndDoorX MyY0 = EndDoorY } } } return *Over if (HalfCopy > 450) : RePlay = 1 gmode 3 , ScreenX , ScreenY , HalfCopy gcopy 4 HalfCopy += 15 return
皆様のアドバイスなどもあり、
ここまで来ました。でも、
升目ピッタリのところで壁に引っ付くのです。
上の97行目のようなところを左に進み続けると
おこります。
何度もすみません、教えてください!!!
※ドアは'Z'で入ります