Player Attack Animations and New 2D Grass Tiles

I know it has been about 3 weeks since my last update. But I have been very busy with my class and job. But I worked on the game a lot over the last couple of days. I made many improvements that I was very pleased with. I was able to fix several bugs that I was encountering as well.

Bug Fixes:

The first major bug was that the edge of the game world was not rendering and when the player crossed the edge of the map the game would crash with an out of bounds exception. After redoing the map rendering code, I was able to fix the issue and now the player can walk around past the edge of the world. Which will be fixed when map collision is turned back on. Currently I have it off for testing, and the fact that I am spawning in on a mountain. If I had terrain collision on, I would not be able to get off the mountain currently, because I have not implemented anything to create a path down.

I also had a lot of bugs when resizing the game window. There a still a few issues when the screen size gets very small. But I think I am going to limit the size of the screen to certain ratios. After the fix I implemented, the screen scales much better and the map is rendering properly no matter the size of the screen.

Attack Animations and Sprites:

The largest project I undertook was created the sprites for the player attack animations. Then I also implemented them into the game. So, the player can now attack in all four directions. After implementing that I needed an actual way for the player to attack. I created a new system for collision detection that is much cleaner than my old code. It is working great so far but I do have a small issue with sprites of different sizes working with the same collision code because, the rectangles that detect collision are not being set to the right scale. I will need to fix this in the future.

HUD System:

Furthermore, I worked on a new HUD system for the game. I need to add much more to it, but I was learning just how to create one. Now that I was able to get the game world time to show up in the upper right corner, I would like to add more art to the HUD. The HUD also needs to show much more information than it currently does, but I did get it started. I would like to have it show the players health and have an items bar at the bottom. That will probably be done down the road once I have a better understanding of how to implement it.

Default Grass Tile Update:

Updated Grass Tile
Image showing the updated Grass Tile

The last update over the last few weeks was changing the default grass tile. I updated it using a noise pattern of different green colors. It seems to have worked well so far, and I am quite happy with the new look. I also updated the other grass edge tiles to match it. Additionally, I want to work on other default tiles that are basically just a color. I want to change them to have more details. I think it just makes everything look better. Once the basic tiles are updated, I am going to start working on other objects that will be above the base layer that the player can interact with, to make the game world seem more alive.

I am hopeful that I will be able to post every two weeks again starting next time.

Full Change List:

Added: Player attack animations for all 4 directions
Coded: A HUD interface to show the time of the game world. More coming soon.
Coded: A new collision detection system to determine when the player attacks are hitting other objects in the game world.
Updated: The grass tile to look more like thick grass.
Updated: The other grass related tiles to match.
Bug Fix: Issues with resizing the screen causing map to not render properly.
Bug Fix: Solved the issue with the void space at the edge of the world not rendering properly. Game was crashing when reaching the edge of the world.

Leave a Comment

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