横向卷轴游戏、课程和课程流动

发布于 2024-11-17 18:19:22 字数 257 浏览 3 评论 0原文

我正在尝试用as3开发一款横向卷轴游戏。我的大部分困惑来自于我缺乏对构建控制游戏流程的类的最佳方法的了解。

例如,将游戏状态从主菜单更改为游戏中状态(包括视觉转换)的最佳方法是什么?

我现在考虑的方法是向按钮添加事件侦听器,从而删除主菜单 MC 并添加过渡 MC。然后,我向转换 MC 添加一个事件侦听器以监视帧标签“转换结束”。这将删除过渡 MC 并添加 GameContainer MC。

这有效率吗?还有其他更简单的方法吗?

谢谢

I am trying to develop a sidescroller game in as3. Most of my confusion is coming from my lack of knowledge on the best way to strucutre the classes that control the games flow.

For example, what would be the best way to change the game state from the main menu, to the in game state, WITH VISUAL TRANSITION INCLUDED?

The way I'm thinking of doing it now is adding event listeners to buttons, which remove the main menu MC and add a transition MC. Then I add an event listener to the transition MC to watch for the frame label "end of transition". This removes the transition MC and adds the GameContainer MC.

Is this efficient? Are there other ways to do it that are easier?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽袖吟 2024-11-24 18:19:22

我认为处理 Flash 视频游戏中的状态的最佳方法是将状态创建为 MovieClip 子类。然后,您创建一个 StateManager,能够从一种状态转移到另一种状态,处理其间的任何转换。至于菜单和游戏中状态之间的转换,我不知道你是如何做到的,但你应该考虑在转换期间加载特定于级别的资源(使用进度条或动画),并在完成时移动到游戏中。

I think the best way to handle states in a flash videogame is to create states as MovieClip subclasses. You create then a StateManager with the ability to move from one state to another handling any transition in between. As for transitions between the menu and the in game state, I don't know how you are doing it but you should consider loading level specific assets during transition (using a progress bar or an animation) and moving to in game when it finishes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文