top of page
Search
Writer's pictureConor Currie

Jet Pack

Within my game, I decided to implement a Jetpack System.


I first created two movement systems, one when the F key is pressed down, allowing the player to fly, and one when it is released, when the Player then drops. This is the Flying and Walking movement types respectively.



I then created a new audio component called 2D Sound. I did this so I could have a sound to give auditory indication of when the Jetpack is and isn't on. When it's on, a loop of a large blaze plays, which I did by Spawning Sound 2D, which I then returned into the 2D Sound audio variable.


I then created a new Custom Event called DepleteFuel, which checked if the Fuel is over 0, in which case, for every 0.5 seconds the player uses the Jetpack, it depletes until it reaches 0. When this happens, the player's movement mode is switched back to Walking, to which they need to find Fuel Pickups until they can refuel.


I then created a new function for the Fuel Pickups called Add Fuel. This checked if the Current Fuel was less than or equal to the max fuel, which if it was, would add the Fuel Regen Amount, being 25, to the Max Fuel.

I then coded the fuel pickups where it would add Fuel when the Player overlaps with the object.



1 view0 comments

Recent Posts

See All

Comments


Post: Blog2_Post
bottom of page