Acrobatic Rocket Car Dash | Development log 1
Firstly, to start making Acrobatic Rocket Car Dash, I set to get the basic mechanics of the game working, including player movement (side to side and jump) as well as the pushing of a ball.
I made a simple first tutorial level to get the mechanics correct. This isn’t going to be the final design of the game, but more of a general feel and aesthetic. Firstly, I used tilemap to create a basic level using some basic, temporary tiles I created in photoshop. These will be replaced later. To get the camera to follow the player around the map, I used Cinemachine and after some tweaking with the orthographic size, I got it working with a slight dead zone so it didn’t feel too locked.
This was my code to my player movement which was fairly simple at first. In lines 7-10 I defined floats for the player speed, jump force, and the movement input. The first time I tried this, I used a fixed update, but upon testing this, I found that the jumping was getting stuck, and often didn’t jump every time I pressed the space bar. therefore I decided to just have a normal Update, I was then able to move around the level perfectly, after some tweaking to the speed and jump force.
To fix the infinite jumping, I decided to use Raycasting to find whether the player is grounded or not using the 2D box collider on both the gound and the player sprite. to ignore the player’s box collider, I made a new layer mask and assigned the tilemap to ‘ground’.