Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

Snake-App

Creating a popular version of the Snake game. The user uses the arrow keys to change the direction of hte snakes movements in order to guide the snake around obstacles and towards the food objects. The game ends if the snake collides with the walls, barriers or any part of the snake body.

This version does not include the termination of the game if it overlaps with its body or hits the walls.

The snake begins with an initial length of 3 segments. This program uses the KeyEvent.VK_UP, KeyEvent.VK_DOWN, KeyEvent.VK_LEFT and KeyEvent.VK_RIGHT constants. When the snake moves outside the bounds of the screen, it will simply loop to the opposite side of the screen and continue the same direction. When food is consumed, a sound will play and the snake will grow one body segment longer.