ActionScript 和 Flash 能否处理复杂的动态加载模块和架构?
我希望开始学习 ActionScript 和 Flash 来编写一个可能非常复杂的游戏引擎。我拥有相对先进的软件架构背景,因此想知道 Flash 是否可以实现一些功能(我认为这对我的引擎很重要):
- 首先,我想模块化我的游戏,以便它既可以用作其他 Flash 项目中的组件,并且本身使用自定义编写的组件进行扩展以扩展引擎本身。
- 我希望能够通过网络动态加载这些模块,以便用户不需要一次下载整个(可能很大)游戏,而只需下载给定时间所需的那些部分。
- 我可能需要在用户计算机上存储较大的游戏保存文件和中间文件,这些文件可能超出 Flash 应用程序的默认允许限制。
- 我可能需要访问某种数据库来存储和检索游戏数据。 Flash 支持任何类型的本地数据访问吗?
引擎本身将相当复杂和抽象,可能涉及大量类以及不同类型的属性和功能。 ActionScript 能胜任这项任务吗?
I'm looking to start learning ActionScript and Flash to write a potentially very complex game engine. I come from a background in relatively advanced software architecture and as such am wondering if a few things (which I consider important for my engine) are possible with Flash:
- First, I want to modularize my game so that it can be both used as a component in other Flash projects, and itself extended with custom-written components to extend the engine itself.
- I want to be able to dynamically load these modules on the fly, and over the web so that the user need not download the entire (potentially large) game all at once, but rather only those pieces needed at a given time.
- I may need to store largish save-game files and intermediate files on the user's computer that may extend beyond the default allowed limit for Flash applications.
- I will probably need access to some kind of database for storing and retrieving game data. Does Flash support any kind of local data access?
The engine itself will be rather complex and abstract, involving potentially lots of classes and different kinds of attributes and capabilities. Will ActionScript be up to the task?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只是一些信息,埃兰的回答相当完整。
1 & 2 = 您可以使用 Flex 模块,它非常方便并且运行良好。您可以在互联网上找到一些教程。它处理得很好,我们用它来动态加载/清理游戏引擎的部分。 更多信息请点击此处
3 = 您可以用来保存客户端计算机上的任何内容,这会将其放置在沙箱中,可以与 Flex 或 Air 一起使用。
4 = 最好使用 RPC、REST 或 WebServices 将内容存储在服务器上。
对于性能问题,这取决于您将使用什么动作脚本。我只能推荐使用 ActionScript 3,因为它可以静态编译并且相当强大。另外,如果你想要真正高性能的东西(例如物理引擎部分或类似功能),你要尽量避免在动作脚本中使用动态类。
希望有帮助:)
Just some info, Eran's answer is pretty complete.
1 & 2 = You can use Flex Modules, it's pretty handy and works pretty well. You may find some tutorials on the internet. It handles pretty well, we use it to dynamically load/clean parts of the game engine. More Info here
3 = You can use to save anything on client machine, that would place it in the sandbox, works either with flex or air.
4 = Better would be using RPCs, REST or WebServices to store the stuff on the server.
For the performance question, that would depend on what actionscript you will be using. I can only recommend using ActionScript 3, since it can be statically compiled and rather powerful. Also, you want to try to avoid using dynamic classes in actionscript if you want something really performant (for example for physics engine part or similar features).
Hope that helps :)
1 是
2 是
3,4 否,可能需要查看 adobe air ,或考虑其他闪存功能,例如协作服务器(blazeds、red5),可以处理所有用户信息,而不是将它们存储在用户计算机上
1 yes
2 yes
3,4 no, might want to look at adobe air , or consider other flash capabilities such as a colaboration server (blazeds, red5) that can handle all your users info instead of storing them on users machine