Stabyourself.net

So here’s a question.
I got a constant “yacceleration”, which acts as the gravity for all the objects. It is added to the speedy (vertical speed) variable of every object, every update (multiplied with delta since last frame).
Now, objects can have a custom gravity (self.gravity), which I use in waterlevels to make Mario fall slower. This overrides yacceleration if set.
The problem is that I made it so that if you enter a floor portal that leads to another floor portal, it forces your speed to be at least a value (minspeed) that allows you to get out of the portals, so that you can’t get stuck.
So what I used to have is:
if speedy > -minspeed then speedy = -minspeed end
This has the downside that it doesn’t take gravity into account at all, so underwater, where Mario has a gravity of 30 instead of 80, this shoots you upwards at a silly speed.
How will I need to change this so that I can make it multiply something with self.gravity or whatever so that the resulting height that you will reach after portalling will always be approximately the same?
I remember something about Ep=Ek -> mgh = ½mv² which I’m sure would help (Ep is at the top, Ek is what I should be finding) but I didn’t pay too much attention and always cheated in the exams.
Whoever solves this gets a cookie.
Since there’s a releasedate, I have to really hurry up with development to get the game “done” about a week before release so I can bugtest enough and get everything else prepared! I’m glad I can still trick myself like that. After the break, check out the big list of stuff I’ve fixed (and added or changed) since the beta started.
The solution is the release date of Mari0. No joke.
Update: The riddle was solved! Enjoy.
By DJ SwanBut like I said, we had way more entries than expected, and some really excellent ones so I decided to make up some categories so I can honor these submissions too! They will also get the beta. See them after the break!
http://forum.stabyourself.net
Great news! Now we have that too! Feel free to register and immediately get banned for making a terrible pun!
With 217 entries and two attempted frauds, the Mari0 Beta art contest is over!
The winners will be announced on Friday like promised.
I’d normally have a funny gif here but I’m currently all out of frames so just use your imagination.