Last weekend I made a prototype of a very simple, but very exciting game. It was made as a prototype of a game concept to use in my school project : "Project Frei".
The idea is fairly simple. You control two busses, and these busses travel a road that progressively gets crazier.
At the moment the game doesn't have any objectives, but it is a heck of a lot of fun to play.
So, one of the things I did at first was to have a simple cube move forward. I did that with a constant translate of the z position.
Eventually I added controls (even for DS4/X360 or other Xinput compatible controllers).
The controls had to be simple and accessible.
The fun thing about the game is that it can be used both singleplayer and multiplayer. As a singleplayer game it's harder because you control two busses at the same time.
^ Open to see the current controls.
Anyway. More about the code.
Eventually I managed to add a camera to move along as well. As well as a "Collider Cage" to prevent busses from getting out of bounds. This "Playzone" sums up the z position of both the busses and divides it by 2 to have the average of both busses. it then translates itself towards that position.
I also made Jump Pads and Boost Pads. These work with a Box Collider, Once the bus hits something tagged "Jump" the bus will increase its rigidbody's y velocity by a certain amount. The same is try for "Boost" tags and the z velocity.
The bounds also translate the player back to it's original position.
As you can see in the above code I also added some camera shake. That increases the action value of the game.
I think this is an incredible fun project to work on, and I'll post more updates about it when I have more to show.