キー操作: ↑キーで前進 ↓キーで後退 ←→キーで方向転換 Usage: Arrow up to move forward Arrow down to move backward Arrow right and left to turn
https://wiki.scratch.mit.edu/wiki/Sprite-Based_Raycaster_Tutorial ↑を検証してたら、変数名間違い、不要な処理などがあったので、修正してとりあえず動くようにした(→その後、明らかな誤りはWiki側にも反映)。あと、壁を通り抜けないよう、当たり判定を足した。ついでに、コンパスもつけてみた(ないと自分が道に迷うので……)。 参考: http://lodev.org/cgtutor/raycasting.html ※おそらく、英語版Wikiの元ネタ。すごく親切にレイキャスティングの説明をしてくれているので、コード内容に疑問をもった方は、英語ですが、ぜひチェック。 This project is based on a sample at "https://wiki.scratch.mit.edu/wiki/Sprite-Based_Raycaster_Tutorial". *correct some variable names *remove unnecessary variables and blocks *add checking if player hit the wall or not *add a compass function Based on: https://wiki.scratch.mit.edu/wiki/Sprite-Based_Raycaster_Tutorial Reference: http://lodev.org/cgtutor/raycasting.html