Space Invaders – Key input
|
The Arcanoid code we use as the structure for the space invaders clone used mouse input to control the paddle. We wanted to use keyboard input instead so this had to be changed. This task should actually be rather simple, but I had problems to make it work. I spent a lot of time looking at the Arcanoid to figure out where the changes should be made and how to make them. The problem lied in how I had written SDL_KEYDOWN and SDL_KEYUP in Engine::HandleEvents(). I didn’t understand how the SDL mouse input code worked and when I tried to look at that code when writing the keyboard input.
|