1

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!

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
DGH94
  • 97
  • 1
  • 6
  • I would say that this rather depends on the rest of your design, which of course we don't know... – Matthew Gilliard Mar 02 '11 at 19:47
  • Good point, guess I was a little sparse on the details. It's tile based, so basically I'm just trying to find a way to replace the monster tile with the item tile. – DGH94 Mar 02 '11 at 19:52
  • 1
    so, all you need to do is replace the monster tile with the item tile - simple! :) Seriously, you still haven't explained why *that* is difficult... – Mac Mar 02 '11 at 20:12
  • 1
    I think that your question would probably be answered quicker if you post it here. Best of luck;. http://gamedev.stackexchange.net – davidahines Mar 02 '11 at 20:42
  • I think you mean http://gamedev.stackexchange.com/ (the .net goes to a godaddy placeholder) – Chimmy Jun 10 '11 at 19:23

1 Answers1

2

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.

Community
  • 1
  • 1
kitsu.eb
  • 2,996
  • 1
  • 26
  • 28