Pickin’ Sticks 2D Java Game

This is a 2D Java game that I made at the beginning of 2013 while learning Java. The purpose was to learn more about object-oriented programming and how to make 2D graphics in Java. I made this in my spare time, while I was taking a course in Object oriented programming at the university. The game never got completed, it does not have any sound effects or music for example. And maybe it is not very interesting to play. But it was fun making and a did learn a lot. I have programmed everything from scratch and made all sprites myself. The main reason I chose to make “Pickin’ Sticks” was that I ran into this video and got inspired.

All sticks, traps, and even the player are objects. All objects inherit a base object that has an x and y coordinate, size, and the sprite to render. This parent class also handles the rendering of the object and collision detection based on the “intersect()” function in the Java Rectangle class. The game loop used in this game is a simple timer that calls a redraw function at regular time intervals.

Unfortunately, I have lost the source code for this game, but you can download the playable game here: PickinSticks.zip (30KB)

pickinsticks1raw
Click on the image to view it in full size

A few months later I continued to develop the game. I found a way to make the game full-screen using a maximized undecorated JFrame. I also experimented with making a randomly generated tile map. The tiles generate in randomly sized circles with some randomly placed tiles around them too. There are four different ground tiles: grass, sand, water, and lava. All different tile types have different walking speeds. The lava makes the player lose a heart of life every second. In this version of the game, a made the monsters randomly shoot arrows to make the game harder. Version two video below:

I have lost the source code for this version as well, but you can download the playable game here: PickinSticks2.zip (60KB)

pickinsticks2
Click on the image to view it in full size

Leave a Reply

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

Warning: Undefined array key "rerror" in /customers/b/a/5/brinkeby.se/httpd.www/axelsdiy/wp-content/plugins/wp-recaptcha/recaptcha.php on line 291
 

This site uses Akismet to reduce spam. Learn how your comment data is processed.