Hardware Reference
In-Depth Information
It is best practice to make a game as fair as possible but it is up to the developer's judgment. Players will feel
cheated when a rigged game is discovered. If the players have an enjoyable gaming experience, they will return to
play more games. Games can be challenging, and as long as the players skill is the only factor keeping the player
from winning.
As a game developer be-careful about developing games that are chance based and give prizes, as this can be
considered a gambling machine and is highly regulated. But don't be afraid to develop games that provide prizes;
it is usually the monetary value of the prize and the frequency that a prize can be won that determines if a game is
classified as a gambling machine. A game that always gives a ticket, a piece of candy or a small toy just for starting
the game and the game gives more prizes out the longer the player plays is usually not considered gambling because
something is awarded for every play and in some cases just putting in a token will award some tickets. Alley roll is an
example of this; most alley roll games will provide one ticket for getting the ball to the other end, but if the ball makes
it into a scoring ring, more tickets are awarded. However, it is always best to research the laws and regulations when
building games that give out prizes.
Adding Better Displays and Graphics
A lot of unique games can be made with displays made of arrays of LEDs, mechanical flip dots, character LCDs, or
small LCD panels. The games made with displays of these styles can sometimes lack the extra shine that may be
desired from a television or a computer monitor. The Arduino with a couple of resistors can drive a television using
the TV out library ( www.arduino.cc/playground/Main/TVout ), but is only capable of providing black-and-white
images and only works with devices that have an RCA connection. To have the power to drive more complex graphics,
additional hardware—a graphics processing unit (GPU)—is required.
The Gameduino was designed to be a GPU for the Arduino and is a shield that provides a graphics platform that
can create complex graphics and animations. The Gameduino's processor is programmed in to a Xilinx Spartan Field
Programmable Gate Array (FPGA) and can connect to any microcontroller that is capable of SPI communication, even
though it is packaged as a standard Arduino shield. The Gameduino can output video to a VGA-comparable display
at 400×300 pixels with 512 colors, and can fully draw sprites, bitmaps, and backgrounds and generate stereo sound.
The Gameduino is compatible with computer monitors with at least 800×600 resolution. The graphics capabilities of
the Gameduino are very similar to 1980s video game consoles and older arcade games. The Gameduino also includes
a secondary coprocessor that is independent of the main graphics functionality and is used to generate bitmaps for
wireframe effects and control the video registers to create split-screen games.
The use of the Gameduino offloads all the graphics and display functions from the Arduino, leaving the Arduino
free to control the game logic, handle user input, and track game progress. The Arduino initializes the Gameduino
by copying to RAM all image data, sound data, and, if necessary, programming for the secondary processor to the
Gameduino's memory. The Gameduino has 32 KB of internal memory and is split up into background images, sprite
images, and program space.
This chapter just introduces the Gameduino basics to show you how to build a functional game. Gameduino
reference material is available at www.excamera.com/sphinx/gameduino/ and has samples and tutorials for more
complex game feature, such as split screen and 3D wireframe. Download the quick-reference poster for working
with the example in this section from the above site. The Gameduino is available at many online retailers, such as
SparkFun Electronics, Adafruit Industries, and Jameco electronics.
Gameduino Library
The Gameduino is a SPI device that you can run the with standard SPI communication practices mentioned in Chapter 10.
But for ease of getting games working quickly, the Gameduino library will be used for this section, and is available on
the Gameduino's website ( www.excamera.com/files/gameduino/synth/sketches/Gameduino.zip ). The library installs
in the standard Arduino location and needs to be modified to work with the Arduino 1.0.1 and above IDE.
 
Search WWH ::




Custom Search