Lap Timer and Checkpoint system

This week i have been working more on the foundations of my game, i realised that i had been spending a lot of time working on my player controller and tweaking small changes instead of going ahead and making a win lose value for the game. My game play loop is to complete 3 laps within the gold, silver and bronze times and pass through all the checkpoints to register your progress.

The first thing i had needed to get done was a checkpoint system that would continuously spawn the next checkpoint available to the player as well as turning off the previous checkpoint, i needed this system in the game as soon as possible because as soon as i get them in the player will be notified in the tracks direction and will feel more inclined to drive through the set path than to ignore them and drive round in the wrong direction. i have shown my blueprinting and scripting below to see how i have achieved this system. the checkpoints are all stored in an array within this blueprint this is going to be helpful to us for when we need to check if the player has done a lap.


As well as this i needed to create a lap timer, this is crucial because with this being a time trial based racing game the player needs some indication of how well they are doing on each lap. before i can go ahead and create the timer i need to make a timer conversion blueprint, the reason for this is because unreal engine 4 uses a different time system to a regular stopwatch would. I have shown my blueprint below that would convert this and from there it is read to use within my lap timer and lap check systems.



lastly this week i needed to create a blueprint that would check the players lap time and also update which lap they are on. I have created all of this in a tracker blueprint, within this blueprint is variables for the maximum amount of laps and also the gold, sliver and bronze target times. Every lap that the player makes will check if the last checkpoint has been passed and if it has done it will update the lap to the next available one.

-JLP


Comments

Popular posts from this blog

Casual Testing & Slight Adjustments

Final Blog Entry

More Distractions and Bug Fixes