Stairs! (Devlog 3)
I have made “stairs” in my game Blood Axolotl!
Setup
To be honest, the idea is very simple. All that is happening is that the Physics Object is being displaced to sit on a line. That’s it.
What do you know of a little something called y = mx + b?
To make the Physics Object sit on a line, what I have to do is change the y value (stairs move you up/down). To get what the y value should be all I have to do is solve for y on a slop, such as y = mx + b (my 5th grade math teacher would be so proud of me). But, to be honest slope intercept form kinda sucks, (my 5th grade math teacher rn:
), so I’m using point slope: y - y_1 = m(x - x_1) more specifically, y = m(x - x_1) + y_1 to get just the y value.
Outcome
It works good, more like a ramp, but the game needs more development in every other aria before making the stairs more like stairs.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.