Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Thank you very much for this tutorial series!!!

I have added some code to the player so that you can increase/decrease your max speed from 0 to 12 by clicking the left/right mouse buttons.

I have made some ramps and placed blocks next to them. At a slow speed the player can go up and down the ramps and continue along the blocks fine.

However when the player goes up the ramp in a faster speed, the player will collide/bump with the next block and stop, before continuing again. The work around I found to stop the collision/bump, was to increase the z_step.

"
if instance_place(x,y,o_ramp_LR) or instance_place(x,y,o_ramp_RL){
position.z_step = 16;}else{position.z_step = 4;}
"
without posting a video or the full code/project here.

Is this correct?

(1 edit)

You might want to make z step equal to the absolute value of  speed + 1 (speed on x/y axis only). Then, the further (i.e. faster) you step into the slope, the higher the step the player can take. Keep in mind that this could allow the player to climb on anything if their speed exceeds the height of the object.

Thank you for your reply.
I have created a hierarchy o_blocks_parent with, o_blocks and o_ramps as the children. And updated all the collision code with o_blocks_parent. And cleaned up my previous code in the above comment with; if instance_place(x,y,o_ramps){ position.z_step = 4 + abs(speed+1)}else{position.z_step = 4} this way i cant "climb" on anything and it works buttery smooth.

You will be named in the credits.