top of page

377 Blog 2

During this sprint, I started by overhauling the way checkpoints work in the game by completing the following two tasks:

​

  • As a player, I would like the timer to reset to the value it was at the start or at a checkpoint when respawning, but also have a penalty time added for each death so that I still feel appropriately punished

​​

  • As a player, when I fall in a pit I would like the crumbling floors, glass walls, sliding blocks, and powered objects to reset to the state they were in at the last checkpoint so that my progress is saved

Getting the timer and obstacles to reset at each checkpoint was by far one of the most complex tasks that I've completed for this project so far. I couldn't just reload the scene, I needed to save the current situation at each checkpoint and then re-load it when necessary. Rather than building a complex save system however, I merely used a list of stored properties for each obstacle.

​

Crumbling Floors and Glass Walls needed to be modified so that rather than deleting them after activation, they are simply turned off, and can later be turned back on at will. When a checkpoint is touched, it stores a list of each object's current state, like the broken status of glass, the powered state of a button, or the position of a moving block. Then it's just a matter of setting each obstacle back to those stored values when the ball falls in a pit.

Reset 1.gif
Reset 2.gif

Next I worked on a multi-ball mechanic to introduce some more challenging level designs:​

​

  • As a player, I would like to be able to control more than one ball at once, and only complete the level once all the balls have reached a goal area

Multi-ball.gif

This multi-ball mechanic also required a bit of tweaking of existing systems, such as how the ball spawns and de-spawns from the level.

​

I ended up changing the ball from getting destroyed and re-instantiated, to instead keeping the same ball(s) throughout and simply moving them back to the checkpoint positions and resetting things like the size and electric powered state.

One I changed the way in which balls spawned and re-spawned from the level, adding more spawn points into the scene and modifying the goal to require all spawned balls was fairly straightforward. This new mechanic allows for some interesting level possibilities and I'm excited to see how they get used by our level designers and players!

As more and more levels were created for the game, it became increasingly difficult to fit them all on our main menu screen. Additionally, the best times for each level needed to be saved and displayed alongside each level so that players have a reason to re-play levels to improve their best times.

​​​

  • As a player, I would like my best times for each level to be saved so that I have a reason to go back and try to beat them

​

  • As a player, I would like to unlock new levels after beating the previous level so that I feel a sense of accomplishment​

Level Selection.gif
Arrow.png

To better fit all of the levels onto the level select screen I added arrows which switch the currently viewed buttons to the next or previous set, and then broke up the levels into sets of 6. I made the level select button UI a prefab so that modifying one button (such as adding a best time text element underneath) would make that modification to every level select button at once.

For the saving of the best times, I used the Unity PlayerPrefs system. The default best time is set to infinity, and then each time a level is completed a check if performed to see if the level completion time is better than the saved PlayerPref value for that level. If the new time is less, then it is saved as the new best time and overwrites the old one.

The game is really starting to come together and I'm quickly running out of programming tasks for the project. During sprint 6 I am planning to complete the following:

      - Improve the ease of touching the goal at the end of a level

      - Dedicated pause, restart, & quit buttons when playing levels

      - Bronze, silver, & gold ranking system for each level

      - Global Leaderboard system

      - Various SFX implementations

​

Thanks for reading, until next time!

bottom of page