Tonyu(豆乳)でゲーム製作-2-at GAMEDEV
Tonyu(豆乳)でゲーム製作-2- - 暇つぶし2ch69:名前は開発中のものです。
05/03/19 00:58:43 Dez6S2iy
俺もなにもわからず最近はじめたばっかりで、いろんなとこからひっぱってきたりこねくりまわしたりしてる
while(1){
if ($map.getAt(x-16,y)==$pat_Block+0) x+=3;
if ($map.getAt(x+16,y)==$pat_Block+0) x-=3;
if ($map.getAt(x-15,y)==$pat_Block+0) x+=5;
if ($map.getAt(x+15,y)==$pat_Block+0) x-=5;
if ($map.getAt(x,y-20)==$pat_Block+0) y+=2;
if ($map.getAt(x,y+23)==$pat_Block+0) y-=4;
if ($map.getAt(x,y-23)==$pat_Block+0) y+=2;
// if ($map.getAt(x,y+20)==$pat_Block+0) y-=2;
anim.pause();
if (getkey(39) && $map.getAt(x+16,y)!=$pat_Block+0 ) {
x+=3;
f=0;
anim.swing($pat_player+0,$pat_player+2,5);
}
// ↑ カーソルキー右が押され、さらに右側が壁でなければ右へ移動
if (getkey(37) && $map.getAt(x-16,y)!=$pat_Block+0 ) {
x-=3;
f=1;
anim.swing($pat_player+0,$pat_player+2,5);
}
// ↑ カーソルキー左が押され、さらに左側が壁でなければ左へ移動
y+=vy; // vy: y 方向の速度。 yにvy を加える
if ($map.getAt(x,y+24)==$pat_Block+0 ) { // ブロックに当たっていたら
vy=0; // 落下速度を0にする
if (getkey(32) && $map.getAt(x,y+5)!=$pat_Block+0 ) vy=-10; // スペースキーを押したらジャンプ
if (getkey(32) && $map.getAt(x,y-20)==$pat_Block+0 ) vy=-1;
} else { // ブロックに当たっていなかったら
vy+=0.5; // 落下速度を上げる
}
じつにきったないが参考にでもなれば


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch