You play the roll of Nuts, a simple squirrel with a simple goal of collecting as many nuts as he can before the snake does. While you control Nuts to find his food, the snake will be moving around as well with the same objective. If the snake spots Nuts, he will spit poison at our hero. You must maneuver around obstacles while avoid the snake to collect your food.


Controls

- Use the up, down, left and right arrows to move your squirrel around. - (DEBUG) Shift+D - Enables debug mode which shows the game grid, A* pathfinding calculations and current state of the snake.
- (DEBUG) Shift+I - Snake will just pathfind to the nuts and ignore the player's presence.
- (DEBUG) Shift+V - Makes the player invunerable to the snake's poison.
- F11 - Toggles between fullscreen and windowed mode


Purpose - The purpose of Nuts is to demonstrate A* Pathfinding which the snake AI will use in order to get to a random nut on the screen while avoiding any obstacles that may be in the way. The AI also has a finite state machine build in which houses three different states. Searching, attack, beserking search and beserking attack states are the four states that are listed as followed.

Searching - The snake has chosen a random nut to pathfind to and chase after. The A* pathfinding is calculated right before this state is set giving the snake an array of grid spots to follow before the goal is reached.

Attack - The snake has direct line of sight with the player when it enters this state. While in the attack state the snake will not follow its pathfinding array, but instead will stay stationary and shoot poison every couple of game tics at the player.

Beserk Search - The snake enters a beserk mode when it cannot find any more nuts to pathfind to. In the beserk state, the snake moves at a much faster rate and pathfinds towards the player himself until he comes in line of sight with the player. Beserk Attack - This state is almost identical to the normal attack state except the snake shoots poison much faster and at a much faster speed than normal.

Download Nuts 1.0 (2.55mb - http)
Download Nuts Source Code 1.0 (33.6k - http)


Leavethisplace.com