简体   繁体   English

ActionScript-3物理库

[英]ActionScript-3 physics libraries

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? AS3中是否有任何物理引擎可用于此目的,还是我必须从头开始编写和建模其行为?

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. 如果您对学习感兴趣,建议您阅读Keith Peters的Foundation ActionScript 3.0 Animation书。 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. 话虽这么说,但我认为Flash当前最受欢迎的物理引擎是流行的C ++引擎Box2D,该引擎最近已使用Adobe的Alchemy移植到AS3。 included in the ActionScript port is a "World Construction Kit" component for Flash Professional. ActionScript端口中包含的是Flash Professional的“世界构建工具包”组件。

more here: Box2d Flash Alchemy Port + World Construction Kit 此处的更多内容: Box2d Flash炼金术港口+世界建设工具包

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM