Monday, January 16, 2012

Lootable items on map and placeholders

I will be drawing placeholders for items as I do not want to spend 2 - 3 hours drawing something like a chest. I would rather spend the time programming. So my first place holder is a chest, it's not pretty, but with a bit of imagination, you can see that it is.

I have added a hash map to my map class that contain MapItemGroup where the key is an integer that is calculated based on x and y coordinate (y * MAX_MAP_X) + x. All items on them map is pooled in a chest if generated by the map or a bag if dropped from monsters.

I have expanded my move command to check the map for item groups and change the image from chest_closed to chest_open if it's a chest and the same for bag's.

Chests also have light on them, to make them look like they are part of the game and not just a sprite drawn on top of every thing else. I just add the color values of r, g, b and divide by 4 to average them and use that as a single color for the chest.




There's still no items in them, that's the next thing.

No comments:

Post a Comment