有没有比时间线 *flash* 更好的做法来保存怪物图像
假设我的游戏中有一些怪物,它们需要随机生成。他们需要一些图形,但我不确定最好的方法是什么。我读过一本书,其中作者使用时间线来保存卡片的不同图像。然后,卡片类将从时间线设置其内容。在我看来,这听起来确实像是硬编码。是否有更好的解决方案,例如将图像保存在数组中等。
Let's say I have some monsters in my game and they need to be generated randomly. They need to have some graphics and I am not sure what's the best way to do so. I have read a book where the writer used the time line to hold different images for cards for instance. The card class would then set it's content from the time line. In my opinion this really sounds like hard coding. Aren't there any better solutions to this like holding the images in an array or so.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种方法是使用 xml 文件来引用所有怪物,这些可以是图像或 swf,没关系,给它们一堆 id,然后使用 bulkloader 将它们全部加载进去。然后你可以使用它们在bulkloader中的id来获取它们,检查一下。
One way would be to use an xml file to reference all your monsters these can be images or swfs it doesn't matter, give them a bunch of ids, then use bulkloader to load them all in. You can then get hold of them using their ids in bulkloader, check it out.