Minimalist gaming geekery.
Mar. 31st, 2003 11:25 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Having seen the gamebutton arcade and Joust Pong, oddly enough both by Kirk Israel, I sometimes think about what other games might be possible with a single-button controller.
I was listening to Elvis in my friend's car, thinking about the etymology of "rock and roll", and then it hit me.... a single-button rock-and-roll control for lateral movement.
Imagine, if you will, an egg-shaped ship and a single "roll" button. In the default state, the ship rocks left and right, in a fixed position. When the "roll" button is depressed, the ship rolls in whichever direction momentum would dictate. If it was rocking to the right, it'll start tumbling right, and if it was rocking to the left, it'll start tumbling left.
There are obviously some details as to how to work this out. I worked out the basic algorithm on a napkin at a restaurant.
The variables are simple enough:
* position
* velocity
* acceleration
* angle (of rotation)
The constants in the algorithm would be:
* how many pixels the ship travels in one revolution.
* how fast it rocks (absolute value of acceleration)
* how far it rocks (maximum acceleration)
And, as the napkin has it, the algorithm goes like this:
if button not pressed:
if abs(velocity) > max:
accelleration *= -1
endif
velocity += accelleration
endif
position += velocity
angle += velocity
It's about that simple; the only thing I can imagine changing about that is the "if" statement; this version obviously doesn't take into account an egg-ship's center of gravity. maybe make the sign of the acceleration variable dependent on which way the egg is pointing... in that case, you risk the egg becoming stationary if it stops without much momentum, but all you have to do is hold down "roll" until it slowly teeters enough to its side to get a good rock back.
I'll have to run some simulations when I get home tomorrow.
Somehow I think I give it more credit because it was written on a napkin, and so was the Gettysburg Address, but then, so was Nigel's blueprint of the Stonehenge prop in Spinal Tap.
I was listening to Elvis in my friend's car, thinking about the etymology of "rock and roll", and then it hit me.... a single-button rock-and-roll control for lateral movement.
Imagine, if you will, an egg-shaped ship and a single "roll" button. In the default state, the ship rocks left and right, in a fixed position. When the "roll" button is depressed, the ship rolls in whichever direction momentum would dictate. If it was rocking to the right, it'll start tumbling right, and if it was rocking to the left, it'll start tumbling left.
There are obviously some details as to how to work this out. I worked out the basic algorithm on a napkin at a restaurant.
The variables are simple enough:
* position
* velocity
* acceleration
* angle (of rotation)
The constants in the algorithm would be:
* how many pixels the ship travels in one revolution.
* how fast it rocks (absolute value of acceleration)
* how far it rocks (maximum acceleration)
And, as the napkin has it, the algorithm goes like this:
if button not pressed:
if abs(velocity) > max:
accelleration *= -1
endif
velocity += accelleration
endif
position += velocity
angle += velocity
It's about that simple; the only thing I can imagine changing about that is the "if" statement; this version obviously doesn't take into account an egg-ship's center of gravity. maybe make the sign of the acceleration variable dependent on which way the egg is pointing... in that case, you risk the egg becoming stationary if it stops without much momentum, but all you have to do is hold down "roll" until it slowly teeters enough to its side to get a good rock back.
I'll have to run some simulations when I get home tomorrow.
Somehow I think I give it more credit because it was written on a napkin, and so was the Gettysburg Address, but then, so was Nigel's blueprint of the Stonehenge prop in Spinal Tap.