The Nokia inspired
Sankes game implemented on 8051 platform. The game is built on AT89S51 MCU
operating at 27MHz crystal frequency. The game uses a 16 * 8 LED dot matrix
display and five way keys for user interface. A dedicated delay settings key
provides one touch access to the delay settings mode where the speed of the
Snake can be adjusted. Highlights of the game are,
1. As
in the original game, the Snake grows
in size as it snatches the eggs
2. Eggs appear periodically on the screen
at random pixels and will disappear if not snatched within a certain period of
time
3. The snake sees no boundaries at the
edges of the display, will propagate in to any edge and enter from the
opposite edge
4. The Snake can be accelerated /
decelerated on the fly
5. There is also a separate delay settings
mode to adjust the Snake's speed
6. The game ends when the Snake collides
with itself.
7. The total eggs snatched is then
displayed as the game score
8. The gaming console will hibernate if no
user event occurs in 25secs! The game can be resumed by pressing external
interrupt / master reset keys!
Various
Operation:
Welcome Graphics
During the start up, a small
animation is played on the screen which first displays the name of the platform
(8051) for some time and then scrolls the name of the game, “Snakes”, on the
display once.
Delay Settings Mode (Adjust Snake‟s
Speed)
The Delay Settings Mode can be
invoked from the Stand By state, Paused state or while the game is on. This
mode helps the user to adjust the snake‟s speed. The speed level can
be estimated from a bar graph as well as an indicator snake that continuously
traverses the screen, which gives a better feel of the speed setting.
Stand By Mode
The application enters the stand by
mode, as soon as the “Welcome Graphics” animation is displayed. The application
also returns to this mode soon after the end of a game and then, begins waiting
for a user signal to start the next game.
The keys associated with the Stand
By mode are given below:
The Game Mode
The entire application is centered
around the game mode. By pressing the „Play‟ / ‟Yes‟
keys in the Stand By mode, the game begins. The snake runs continuously on the
screen and can be controlled by the direction keys. Eggs appear periodically on
the screen at random pixels and the user is expected to guide the snake to the
eggs before they disappear after a certain period. It is enough to bring the
snake one pixel away from the egg; the snake snatches them automatically and
grows in size by one pixel. The objective of the game (for the sake of the
folks living under a rock…) is to snatch as many eggs as possible and stay
alive by avoiding the collision of the head of the snake with it‟s
own body. The game ends when a collision is detected and the number of eggs
snatched is then displayed as the game score.
The direction keys marked Right,
Up, Left and Down are the game action keys and are used to control the movement
of the snake. If a direction key mapped to the current direction of movement of
the snake is pressed, the snake accelerates. Similarly, if the key mapped to
the opposite direction is pressed, the snake slows down. Remaining two
direction keys alter the direction of movement of the snake when pressed.
The source files „GameFrontEnd.inc‟,
„GameBackEnd.inc‟ and „EggHandle.inc‟ define the Game Mode. All the
three files are placed in page two of ROM
Paused Mode
The game enters paused mode when
the user presses „Pause‟ key in game mode. In this mode, the user can either
choose to continue the game or quit. In the latter case, the game score is
displayed and the application enters Stand By mode.
Microcontroller Circuit:
Display Board:
For Program and Hex File Contact to
Nazish Shahab.
Price in Jaipur Rs: 4000
Price in Other Cities Rs:4500
M.No: +91-7665409048