Java Snake

Description

In this project i wanted to recreate one of the old school favorite games of Nokia Snake , A common enough exercise i wanted to build it the way i would before looking at anyone else’s source, i wanted to make it so that potentially the Snake board could be of any size and potentially multiple user snakes, although this version only has the one.

The game itself plays on an undercoated JFrame, with Key-listeners for movement, each part of the snake is taken up by 1 cell of 5*5 pixels , the cherry is one single block and once eaten is added to the snake, This version does not allow passing through walls or back on itself, the Snake thread is updated a Cell every 50ms.

 

This game even in its Small version has quite a bit of play area to potentially play for hours!

 

 

 

Learning goals:

  • Create custom Exceptions for WallHit and SnakeHit
  • efficient use of paint component only updating whats necessary.
  • Building in Java 8 and then re-factoring to Java 6
  • Digitally signing the Jar

 

Language

JAVA

Try it!

 


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *