ActionScript-3 物理库
我想编写一个游戏,其中舞台上会有一些球,它们会随机移动。它们必须具有独特的启动速度和角度,并且应该像真正的台球一样相互干扰。 AS3 中是否有任何物理引擎可能对此目的有用,或者我是否必须从头开始编写它们的行为并对其行为进行建模?
I want to write a game in which there will be some balls on the stage, that will move randomly. They must have unique starting speed and angle and should interfere with each other just like real billiard balls. Is there any physics engine in AS3 that might be useful for this purpose, or will I have to write and model their behavior from the scratch?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,如果您知道该怎么做,“从头开始”这样做并不是什么太大的挑战。如果您有兴趣学习,我建议您学习 Keith Peters 的 Foundation ActionScript 3.0 动画书。学习书中的课程的好处之一(也许还有这本书的续集)是所有的算法和逻辑都可以轻松移植到其他语言。
话虽这么说,我相信目前最流行的 Flash 物理引擎是流行的 C++ 引擎 Box2D,它最近使用 Adobe 的 Alchemy 移植到 AS3。 ActionScript 端口中包含 Flash Professional 的“World Construction Kit”组件。
更多信息请参见:Box2d Flash Alchemy Port + World Construction Kit
well, doing so "from scratch" isn't really much of a challenge if you know what to do. if you're interested in learning i would suggest you pick up Keith Peters' Foundation ActionScript 3.0 Animation book. one benefit from studying the lessons in the book (and perhaps the book's sequel) is that all of the algorithms and logic are easily portable to other languages.
that being said, i believe the most popular physics engine for Flash currently is the popular C++ engine Box2D, which was recently ported to AS3 using Adobe's Alchemy. included in the ActionScript port is a "World Construction Kit" component for Flash Professional.
more here: Box2d Flash Alchemy Port + World Construction Kit