在 ActionScript 中制作一个具有 2D 运动并在撞到墙壁时停止的对象
我想制作一个可以进行键盘移动(上、下、左、右)的正方形,并且当它碰到另一个物体(例如墙壁)时会停止。
编辑:我已经有一个正方形和一个键盘布局,但如果需要特定的东西,请告诉我!
I want To make a square that has keyboard movement (up, down, left, right) and will stop when it hits another object such as a wall.
EDIT: I already have a square and a keyboard layout but if that needs to be something specific then please tell me!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
杰克逊,你需要做的就是
你不是很具体,但我百分百肯定,如果你用谷歌更多地了解你需要的东西,你会找到它,因为有大量的闪存游戏教程。
这是一个最小的设置,
显然它并不理想,但它很基本,并且很容易说明顶部的点状态。
您可能想要使用一些平滑的按键并在 EnterFrame 上更新您的游戏。
祝你好运
jackson, all you need to do is
You are not beeing specific, but I am 100% sure that if you google a bit more into what you need you will find it as there are tons of flash gaming tutorials.
Here is a minimal setup
Oviously it's not ideal, but it's basic and it illustrates the points states at the top easily.
You might want to use some smooth keys and update your game onEnterFrame.
Goodluck