在rogue-like游戏中实现掉落物品的简单方法?
基本上我正在制作一款流氓游戏,并试图在敌人死亡时实现掉落物品。我尝试了几种不同的方法来做到这一点,但没有一个成功。
我只是想知道你是否对如何解决这样的事情有任何想法。谢谢!
Basically I have a rogue game I'm making, and am trying to implement dropped items for when the enemy dies. I've tried a couple different methods on how to do this, and none have been successful.
I was just wondering if you have any ideas on how you would go around such a thing. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我还没有获得当前 wip Roguelike 引擎中的项目,但这是我当前计划的概述:
地图图块和实体都充当实体的容器。当图块中的实体遭受物品掉落事件(即正常死亡)时,您可以将其库存列表的内容附加到图块的内容列表中。
我还计划为图块/实体容量添加逻辑,因此您不能将墙壁移开(通常?),并且图块不能包含无限大的堆。此外,因为您可能想控制项目掉落频率并输入它最好的办法可能是为实体提供一个返回其丢弃的库存列表的方法。
+1 https://gamedev.stackexchange.com/ 不过,我不知道它的存在。
I haven't gotten to items in my current wip Roguelike engine, but here is an outline of my current plans:
Both map tiles and entities act as containers for entities. When an entity in a tile suffers an item-dropping event (i.e. normal death) you could just append the contents of its inventory list onto the tile's contents list.
I also plan to add logic for tile/entity capacity though, so you can't carry walls off (usually?), and tiles can't contain infinitely large piles.. Also since you probably want to control item drop frequency and type it is probably best to give entities a method that returns a list of inventory they dropped.
+1 to https://gamedev.stackexchange.com/ though, I didn't know that existed.