Hardware Reference
In-Depth Information
A Simple Game
Game play is one of the most important parts of game development and is crucial to making a fun and entertaining
game. After a game concept has been brainstormed, building a proof of concept of a game is an important step to iron
out details and mechanics. The proof of concept can help determine if the game is feasible early in the development
process. Simple tests of working concepts are also useful to figure out if the challenges are too difficult for anyone
to complete. Testing concepts is vital, especially if a game mechanism is going involve components that rely on
physics or mechanical contraptions such as a ball toss or claw retrieval. You should develop each game mechanism
as best you can before integrating it with other systems, building each and testing for bugs before setting the final
product into motion. The extra components that make up an arcade game (such as artwork, coin mechanisms, ticket
dispensers, and attractive cabinet accoutrements) can be integrated later in the development process.
The game that you will set up in section is a simple game that challenges reaction time by making the player stop
a sweeping series of LEDs at a specified point within the series. The game is called Stop It, and the main part of this
game is the display with the sweeping of a single-light LED from one side of a series to the other. The challenge for
this game is the amount of time a player has to react. The game appears to move faster when the time a single LED
is on before the next one lights up is lowered. To achieve a level completion the player has to press a button while a
specified LED is on. Stop it will use 11 LEDs and a single button; the winning LED is in the middle, and five LEDs are
on either side.
After each level is complete or micro-win , Stop It will decrease the time each LED is on before moving on to
the next stage. A micro-win will flash an alternating pattern on the LEDs, and after 11 micro-wins, a more elaborate
pattern will flash, signifying a big win . If an attempt fails, Stop it will reset back to the first level, and the succession
to the big win will be restarted. The flash of the LEDs is the reward for the proof of concept. If Stop it were to be
developed in to a full arcade game, the reward would have to be greater than just flashing lights. For example, you
might add 1 point to a score or money to a jackpot for every micro-win, and reward the player with tickets for each
big win. Stop it will also need a risk for the user to place up front to attempt to play. For example, a number of tokens
could be accepted via a coin acceptor before the player is allowed play.
Proof of Concept
Stop It's proof-of-concept setup is described in Figure 11-1 , with 11 1kW resistors connected to 5V power and then to
the anode side of 11 LEDs. The cathode side of each LED is connected to pins 3 through 13—one cathode per pin. The
LEDs will be on when the pin is pulled low, instead of when the pin is high. Turning on the LEDs by grounding is a best
practice for lowering the amp draw though the microcontroller. A button is connected to ground on one side and pin 2
on the other so that the interrupt can be utilized to determine when the player has made an attempt to win. Serial is
not used for this code, but the pins are left alone so that the serial can be used to communicate to other modules. It is
possible to use a couple of shift registers to lessen the pin usage of the Arduino and allow for other devices to connect to
digital pins. This example does not use shift registers, keeping the parts requirement to a minimum.
 
Search WWH ::




Custom Search