Movement in SDL

Started by
9 comments, last by khodas 16 years, 3 months ago
I'm not sure if LazyFoo's tutorials mentioned this, but an alternative to storing an array of keys is to increase the x and/or y velocity of the object at time of KeyDown, and subtract that velocity at time of KeyUp. The object still moves while the user holds the key down, and stops when they release.

This topic is closed to new replies.

Advertisement