Classic Arcade Game- Snake
Project Report - Snake Game
By Pratibha Natani
Course: Software Engineering and Testing-Portland State University
Date: 30 January 2013
Project Description: This game has a board and a snake. There are food items on the board for the snake to consume. The snake moves around on the board and eats the food piece. As it consumes the food piece a new piece is created on the board and the snake length increases by 1. The user can control the direction of the snake with arrow keys. The player cannot stop the snake from moving while the game is in progress, and cannot make the snake go in reverse. If the snake head touches itself or the walls it dies.
Project Requirements:
-
The following minimum game parameters should be set by the player and processed by PHP prior to the start of a game:
-
Board size
-
Snake pace
-
Number of possible simultaneous goals
-
Game behavior should be consistent with traditional rules of play as described on Wikipedia or other available web resources
-
The game animates itself
-
The player directs the head of the snake
-
Colliding with goals/food lengthens the snake
-
Colliding with walls or the tail of your snake ends the game
-
Main game controls should be the keyboard arrow keys
-
Score should be tracked and displayed during play
-
An external style sheet should be present to skin the app
-
There should be no JavaScript errors when the app runs
-
The game has three levels. As the snake consumes specific number of food items the user reaches next level and with each level the snake pace is faster.
Project Files:
-
index.html – The main page of the project which draws a form where user can choose his game options like – Board Size, Snake Pace and No of goals.
-
Snake.php – This file has embedded PHP and Javascript code. PHP script extracts the form parameters from the index.html and processes them. The parameters are used by Javascript to set the game. This file has the main control logic for enabling the game.
-
Snake.css- External style content for the index.html and Snake.php files.
-
food.png- Image of the food item drawn on the board.
-
snake.png- Image of the snake segments which are used to draw the snake.
-
Snake_Report.docx- Brief project summary.
Tools/Languages Used:
• Javascript, PHP, HTML, CSS
• Firebug Lite 1.4.0, Wamp Server, Sublime Text2
References/Collaboration: