Hi. For a final project, I used the concepts of collections, file I/O, inheritance/subtyping, and JUnit to create a simple Snake game with Java Swing.
The general idea and rules behind this game are explained in instructions.jpg. I will also add them below:
Welcome to Snake. You get to control a snake.
Use the [LEFT] [UP] [RIGHT] [DOWN] keys to move your snake.
RED apples will make your snake grow longer. Collecting them will give you 1 point each.
GOLDEN apples will make your snake move faster. Collecting them will give you 5 points each.
Try not to let your snake hit a wall or itself, or it will die and your game will be over.
Click RESET to start, and have fun!
-
BufferedImage usage - https://docs.oracle.com/javase/7/docs/api/java/awt/image/BufferedImage.html
-
Color usage - https://docs.oracle.com/javase/7/docs/api/java/awt/Color.html
-
ImageIO usage - https://docs.oracle.com/javase/7/docs/api/javax/imageio/ImageIO.html
-
JOptionPane usage - https://docs.oracle.com/javase/7/docs/api/javax/swing/JOptionPane.html
-
UIManager usage - https://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html
-
Nimbus defaults - https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/_nimbusDefaults.html
-
Playing the Google Snake game - https://www.googlesnake.com/
-
List of fonts that can be used by Java Swing - https://alvinalexander.com/blog/post/jfc-swing/swing-faq-list-fonts-current-platform/
apple.png, goldenapple.png, gameover.jpg and instructions.jpg were created by me :~)