概要 | |
---|---|
投稿者 | Parafla Quality |
状態 | |
カテゴリー | ActionScript |
投稿日 | 2012-02-12 (日) 21:36:00 |
バージョン | 1.37 |
サンプルpfl.の「ダンジョン1.pfl」を使ってRPG風のゲームを作っている者です。これで質問2回目です。 「ダンジョン1.pfl」の初期設定では、移動不可のマップは1種類しか設定されてないので、複数にするために
{if(haiti[cy-1][cx] != 2){if(haiti[cy-1][cx] != 3){if(haiti[cy-1][cx] != 4) if (Key.isDown(Key.UP)){player._y -=size;_root.onoff = 0;} }}}
とやっても上手くいきませんでした。 一体どうすればよいのでしょうか。
以下がプレイヤーの動きを制御しているスクリプトです。
if(_root.onoff == 1){ {if(haiti[cy-1][cx] != 2) if (Key.isDown(Key.UP)){player._y -= size;_root.onoff = 0;} } {if(haiti[cy-1][cx] != 2) if (Key.isDown(Key.DOWN)){player._y += size;_root.onoff = 0;} } {if(haiti[cy-1][cx] != 2) if (Key.isDown(Key.LEFT)){player._x -= size;_root.onoff = 0;} } {if(haiti[cy-1][cx] != 2) if (Key.isDown(Key.RIGHT)){player._x += size;_root.onoff = 0;} } }
if(){ if(){ }else if(){ if(){ }else if(){ } } }頑張ってください -- 2012-02-13 (月) 13:10:50