This week the whole group has been focusing on what is mos important for the game. Per focuses on the AI, Calle on the Options and Credits and I have been working on the pick-ups in the game; The pickaxe and the matches.
I started with writing a PickaxeObject class and I did it mostly like the walls are created in the game. Both walls and pickaxe inherits their core code from game object. Which gives them basic knowledge such as colliders and also grants them methods as has sprite and has depth and friction (I will explain this one further down) etc.
After I had created the pickaxeobject I realized that I needed a manager for the pick-ups. So I started to create it almost like the object manager were without the tiling because I did not need the pick-ups to tile. This became a bit of a problem for me because I did manager to get the manager to work mostly the way I wanted but I had some problem for the manager to distance the matches from the pickaxe. This was a bit time consuming because I totally messed up when I drew the symbols into the level, I actually only drew in the sprites. When we realized this it all made sense why the collision did not work. But once we realized that our Lead Programmer came up with a different way to get the power-ups working.
Our object manager takes in objects and demands/gives them a depth as well as gives objects a friction within the world. By setting the matches’ and pickaxe’s friction to something different from the regular walls in the world. So when the player collides with a pickaxe the game set the player’s pickaxe to the maximum amount, the same goes for the matches. By doing it this way (which we all admit was a bit cheap) we don’t even need a manager for the pick-ups.
Here you can see the two power-ups, I really like how the fit within the game world.
The other thing I started working on today is the cracks that should show up like an overlay on the walls that you are trying to destroy. I’m having a bit of trouble because the pointer loses track on where the sprite is located when I’m trying to draw it in the window. If it was just a sprite that should be drawn in the world it would be easy but this is only supposed to be drawn on the wall you are actively trying to destroy. So I know how to get the position on the wall but when I call for the object to draw on the position of the wall the game crashes.
But other than that, the game is shaping up really well and I’m looking forward toward completing this project because we’ve been working 24/7 to make “our” game perfect.