3 ms·
This post gave me a great nostalgia moment and I imagine others have similar experiences. I remember trying to code a basic platformer at a young age in BASIC
by stegosaurus 12y ago
This post gave me a great nostalgia moment and I imagine others have similar experiences.
I remember trying to code a basic platformer at a young age in BASIC or something similar. Moving around the character and jumping are the most basic, essential functions.
I tried to reason it out. Ok, so start off slow, after the character has been moving for a bit speed him up. For jumping, add some positive velocity and reverse it after a bit.
It took forever to fine tune and still didn't really work that well. I gave up in the end. We didn't have the Internet then and I didn't really think about asking the librarian or similar 'how can i make a character jump about'.
Fast forward a few years and my schoolteacher introduced the concept of Newtonian mechanics. Acceleration as a rate of change of velocity; the idea of a ballistic trajectory as a quadratic.
Suddenly the problem becomes trivial! That eureka moment I can probably point to as the defining thing that made me choose to study higher level physics.
(Part of it was probably being young and not having the reasoning skills I do now - but I also often think about how access to information is so different now. What would the ten year old me have done with access to Wikipedia? Mind boggling.)
- fenomas 12y agoYou may already know this, but actually even a lot of modern game engines use nonphysical methods for moving characters - it's hard to make the character feel responsive using only impulses and friction, etc. I'm working on such an engine at the moment, and it wound up taking some hacking (e.g. I turn off the player's friction when a movement key is pressed - which makes sense when you think about it but seemed nonphysical at first!). With that said, you've reminded me of an example of this. Years ago I was making a "UFO catcher" crane game in Flash, where the user moves a thingy left and right, and an attached crane arm swings freely like a pendulum. At first I thought: this isn't a damned physics simulation, I'll just hack something up. Then I spent probably a whole day trying to get it to not feel so wrong. Then finally I break down and get the formula for pendulum motion off wikipedia, and 15 minutes later it works perfectly - with maybe three lines of physics code. :D