Item and Inventory System Continued

Tree chopping partially done. Still need animations.

Over the last two weeks I continued working on an Inventory System and an Item system. The major change was I switched my inventory to store data using an array instead of a list. Because inventories are a set size and I think it will be more efficient to handle it this way. I need to next think about how to handle item stacking. Because currently I can pick up 20 items until the inventory is full. But if I pick up 20 pieces of wood, they should not fill every slot in the inventory. They should stack in some way.

Wood Log Sprite:

After changing the inventory system slightly, I created a sprite for a wood log. I then implemented the code to chop down trees. However, I have not added the animations for the player or the tree falling at this point. I have been working on the player attack animations as well and I think for the time being I will have the attack animation be the same as the chopping animation. There definitely is a lot more polish needed, but I think the work so far is a good start.

Attack Animations:

While working on the attack animations I realized that my sprites for running and idling were not anchoring the player sprite at the same location. So, I had to go through and modify the player sprites anchor locations. Now that they are all relatively at the same location I can try and work out how I am going to handle the attacks. The issue is I have 32 x 32 pixel sprites currently. Some of the attack animations will need to be larger to accommodate the weapons. Unless I separate the weapon from the player. I am not sure that I want to do that. For now, I think I am just going to use larger sprites and anchor them at the center point, so the player does not jump around between animations.

Progress:

I feel like I have made little progress over the last two weeks and I am hoping as the semester progresses, I find more time to work on my project. My work and class are keeping me busy but I will do my best to find time to work on this project. Until next time.

Full Change List:

Re-Coded: the inventory system to store items using arrays instead of a list.
Created: wood log asset to drop when a tree is cutdown.
Coded: Player chopping down trees (without animation) into the game.
Modified: anchor points on all player sprites to the center.

Leave a Comment

Your email address will not be published. Required fields are marked *