A Game Controller
For this first assignment we were asked to make a game controller for lunar lander.
I wanted to start by just getting the controls successfully working with the game.
- 2 buttons – 1 for start and 1 for thrust
- I felt like a potentiometer made sense for turning the ship (I was…somewhat right)
While the start button was straight forward, making thrust work required lots of tweaking.
I remember Tom saying that we wouldn’t want to use just a straight key press – and as I initially forgot the key release and watched my ship float off into oblivion – I see why
Everything looked like so in first versions :
But with some testing I realized that the ship never got that much fuel and the roll over rate compared to just the keyboard was incredibly slow. I killed a lot of astronauts. When actually playing the game with the computer keyboard, a player doesn’t tap the key, they hold it down. So I moved the key release outside and tweaked my delays.
This worked much better!
Turning was also an endeavor. I created a dead spot in in the middle of the potentiometer so that users had a spot to return to and to simulate not pressing the keys at all. Without it the lander swings pretty wildly. Even with it the lander still swings pretty quite a bit if you forget to return to the middle.
I told myself I couldn’t make it housing until I’d successfully played the game at least once though so had to figure that out. With the keyboard it’s not that difficult so there had to be a way to make this happen.
I think another way to do this would have been to map the angle of the lander to the position of the controls but because I only had a potentiometer and not a rotary encoder, there was no way to do this unless the potentiometer was returned to the start position at the beginning every single time.
I did eventually landed the thing with some regularity… so it needed a box!
I put my arms across a ruler to see what was comfortable, basically keyboard position, and laid my controls out accordingly.
It’s all cardboard but I at least wanted large buttons, and a wheel that was easier to grab for turning.