Thursday, July 8, 2010

Items and Organization

WWWWWWWWWWWW
W.......@..W
W..........W
....@......W
W........!.W
W..........W
WWWWWWWWWWWW


*****
Items
*****
So it turns out it wasn't that hard to get the implementation of items underway. In fact, I've already defined the potion class, which is a specific type of item, so I'm learning more about inheritance. The level defines a Potion, a health potion, and starts to spawn these randomly around the dungeon. This is all fine and dandy, and it works perfectly, except for one bug: All those potions end up on the same tile.

I don't know whether it's a problem with the Random function, or something I'm doing with determining item placement, but I'll figure that out.


************
Organization
************

Another thing I'd like to smooth out, that won't really have an in-game effect, is how I'm organizing what goes where. For instance, the Move Creature function is sitting up in the main update code, instead of belonging to the Creature class. The Creatures and Items are created as part of the Level, instead of being a list of them on the individual Tiles.

0.0.0.3 should see these properly organized, and proof of concept Items should be up.

No comments:

Post a Comment