Games are, by definition, interactive. Gosu makes this interaction straightforward with a simple interface for detecting and reacting to key and mouse button presses.
There are two primary ways to handle input in your program. The first is an event-oriented approach. When buttons are pressed, your programs receives an event and you can react accordingly. The second is to check if, at the time of an update, a certain button is pressed. Both techniques are perfectly valid, use whichever one suits you best.
This article is part of a series. Read more articles about Rapid Game Prototyping in Ruby


