【2D】ゲーム作成ツールGameMaker part3【マンセー】at GAMEDEV【2D】ゲーム作成ツールGameMaker part3【マンセー】 - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドのURL■項目テキスト16:名前は開発中のものです。 08/05/12 00:15:01 Nz3aygB6 条件文が意味不明だ。なぜ、Check Object を使うのか。 条件にあるxとyの値が決め打ちなのも意味不明。 君がやりたいことは、 ・マウスの方向によって画像を変更する なのだろう? なら、「マウスの方向」が条件になるはずではないか。マウスの座標は mouse_x mouse_y で知ることができる。 そして、自キャラから見たマウスの方向は、point_direction() という関数で知ることができる。 アイコンによる設定の説明は面倒なので、コードだけ書いとく。(Varアクションと TestExpression でできるけど) ステップイベントにExecute Code アクションを追加して、中身を下のやつをコピペしてみ。 spr_k001_xx は向きにあわせたものに直してくれ。 direction = floor(point_direction(x,y,mouse_x,mouse_y)+22.5); if (direction>=0 && direction <45) { //右向き sprite_index = spr_k001_xx; } else if (direction>=45 && direction <90) { //右上 sprite_index = spr_k001_xx; } else if (direction>=90 && direction <135) { //上 sprite_index = spr_k001_xx; } else if (direction>=135 && direction <180) { //左上 sprite_index = spr_k001_xx; } else if (direction>=180 && direction <225) { //左 sprite_index = spr_k001_xx; } else if (direction>=225 && direction <270) { //左下 sprite_index = spr_k001_xx; } else if (direction>=270 && direction <315) { //下 sprite_index = spr_k001_xx; } else if (direction>=315 && direction <360) { //右下 sprite_index = spr_k001_xx; } 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch