如何为 Flash 做一个合适的 Haxe 预加载器,或者你认为最好的方法是什么?
我最近开始在Haxe中开发一款针对Flash平台的游戏。 我可以说我不太习惯 Flash 及其工作原理,很明显它是用于动画的。但无论如何,现在我正在制作的游戏开始变得很大,需要几秒钟才能加载,我希望有一个漂亮的预加载器,在用户等待时给用户留下良好的印象。
我发现这个
我还发现了这种 " half-preloader”,它只是一半,因为它只加载稍后需要的资源。但在我的游戏中,到目前为止,与代码相比,资产只是一小部分,这意味着在预加载器显示之前还有几秒钟的灰色方块。我猜想,如果 1-3 秒(或更长时间)内没有看到任何事情发生,很多人可能会认为游戏已损坏并离开。
如果有人有一个功能齐全的方法可以让我使用 Haxe 编写预加载器动画,我会很伤心。我也在使用 swfmill,如果相关的话,我的编码站是 10.04 64 位 Ubuntu 笔记本电脑。
I have recently begun to develop a game in Haxe which targets the Flash platform.
I can say that I'm not really used to Flash and how it works, it is really apparent that it was intended for animations. But anyway, now that game I'm making is starting to be that big that it takes a few seconds for it to load that I want to have a nice preloader that makes a good impression while the user is waiting.
I found this Haxe flash preloader written in Haxe and it seemed like the perfect thing, but it is broken since Haxe changed how its start-up mechanism works - and I do not really know what it is doing so I do not know how to fix it either. It seemed to work at first but then it just stuck into some kind of loop and utilizing 100% of one CPU-core.
I also found this sort of "half-preloader", it is only half in the sense that it only loads assets that is needed later. But in my game the assets is, as of now, a small fraction compared to the code, that means that there is still a few seconds of a grey square before the preloader shows up. I guesses that many might think that the game is broken and just leave if they do not see anything happen in 1-3 sec (or maybe more).
I wounder if someone has a fully functional method that allows me to code preloader animation using Haxe. I'm also using swfmill, my coding station is an 10.04 64-bit Ubuntu laptop if that is relevant.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于这个问题没有现成的解决方案,但应该是可能的。 (例如:Haxe simple flash preloader)
另一种解决方案是创建两个单独的 swf 文件并加载第二个是
flash.display.Loader
。There is no out-of-the box solution for that problem, but it should be possible. (E.g.: Haxe simple flash preloader)
Another solution would be create two separate swf files and load the second through
flash.display.Loader
.