[表示 : 全て 最新50 1-99 101- 201- 301- 401- 501- 601- 2chのread.cgiへ]
Update time : 03/15 23:49 / Filesize : 242 KB / Number-of Response : 657
[このスレッドの書き込みを削除する]
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧] [類似スレッド一覧]


↑キャッシュ検索、類似スレ動作を修正しました、ご迷惑をお掛けしました

【2D】ゲーム作成ツールGameMaker part3【マンセー】



15 名前:名前は開発中のものです。 mailto:sage [2008/05/11(日) 23:56:50 ID:AX4c16UA]
スプライト8枚じゃなくて、1枚のスプライトでサブイメージ8枚にする
(1番目が右向き、2番目が右上、3番目が上、……と0°から反時計回りに並べる)
で、Stepイベントで
image_singe = point_direction(x, y, mouse_x, mouse_y) / 45
と設定すればいけるはずだけど。
(厳密に言えば、image_singleはGM6以降では廃止されているので、
image_indexを設定してimage_speedを0にするのが正しい)

ちなみにどうしてもスプライト別々でやりたいなら、
変数を一つ設定しておいて
set the variable direction to point_direction(x, y, mouse_x, mouse_y)
if expression (direction < 22.5 || direction >= 337.5) is true // 8角形に「?」のアイコンを使う
set the sprite (右向きのスプライト)
if expression (direction >= 22.5 && direction < 67.5) is true
set the sprite (右上のスプライト)
if expression (direction >= 67.5 && direction < 112.5) is true
set the sprite (上向きのスプライト)
……(中略)
if expression (direction >= 292.5 && direction < 337.5) is true
set the sprite (右下のスプライト)

みたいな感じに判定していく。ここまでくるとGML書いてるのとあまり変わらんけど、
アクションだと複数条件の組み合わせはうまく表現できないからね。






[ 続きを読む ] / [ 携帯版 ]

全部読む 次100 最新50 [ このスレをブックマーク! 携帯に送る ] 2chのread.cgiへ
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧]( ´∀`)<242KB

read.cgi ver5.27 [feat.BBS2 +1.6] / e.0.2 (02/09/03) / eucaly.net products.
担当:undef