Forums - Open Redstone Engineers
Game maker gravity - Printable Version

+- Forums - Open Redstone Engineers (https://forum.openredstone.org)
+-- Forum: Off-Topic (https://forum.openredstone.org/forum-4.html)
+--- Forum: Programming (https://forum.openredstone.org/forum-8.html)
+--- Thread: Game maker gravity (/thread-2821.html)



Game maker gravity - David - 03-18-2014

http://arachnoid.com/latex/
Hello! I'm just learning game maker, and I've created a formula for the gravity that is kinda sorta the gravity of earth. This formula is:
[Image: gif.latex?gravity%3D.33%2F125*room%5C_speed]
room_speed is the fps. This results in how many pixels your object should fall every frame (if you want this formula explained, just ask).
Now I'd like the player to jump about 1 meter into the air, I've worked out this equation (I just had exponential growth in math class):
[Image: gif.latex?p*(.33%2F125*room%5C_speed)%5Ep%3D1]
p is the player's jump height
Now, let's say our fps is 60.
[Image: chart?chf=bg,s,fffff0&cht=tx&chl=p*(0.1584)%5Ep%3D1]
there's where I get stuck, I just had the log function in math class, and I understand it. But I'm not sure how to apply it with this problem. The only way I can think of is:
[Image: chart?chf=bg,s,fffff0&cht=tx&chl=%5E%7B0...frac%201p)]
But yeah, no way I can see to solve that problem since you can't work out 1/p further.
Any solutions? With explanation, please.

PS: Mathjax does not work anymore for some weirdo reason. I had to use a site that generated latex images for me.


RE: Game maker gravity - Legofreak - 03-19-2014

i dont know if im looking at this wrong but gravitational acceleration has a parabolic curve, not a logarithmic curve...

its been so many years since i have used game maker but i thought it had gravity options built in.


RE: Game maker gravity - David - 03-19-2014

(03-19-2014, 03:40 AM)RekcirBrickeR Wrote: i dont know if im looking at this wrong but gravitational acceleration has a parabolic curve, not a logarithmic curve...

its been so many years since i have used game maker but i thought it had gravity options built in.

Yeah, you're right, now I feel fucking stupid. #OREproblems
And yes it does, but it's not very flexible I've heard. Never actually used it though, so not sure if it's true.