2048 Java Version

Description

After spending two days solid playing (and failing) at 2048 Check it out i decided if i was going to continue spending some time a  this game I might as well attempt how i would make it myself.

  • The goal of the game is to get a tile with 2048 in it.
  • With every movement of the tiles another random tile is added to the board on the 4 x 4 grid.
  • Tiles fold into one another if pushed on top of each other and have equal value, doubling.
  • If you have no moves left the game ends.
  • Tiles move direction UP DOWN LEFT RIGHT only. each tile will move as far as possible in the direction provided.

I decided it best not to look at the source code until i had completed my attempt. It took half a day to do 90% of it another day to do 95% of it and an absolute age to figure out how i could get the looping structure to perform correct in all directions.

I used a Multi dimensional array for the board its self, but displayed all the tiles as JPanels.

The Jpanels received a colour generated on a shift of the previous colours.

Learning Goals

  • To copy a game, and emulate the Logic
  • Understand Grid patterns , multi dimensional arrays.
  • To add limited sound effects
  • Using inner Classes.

Language Used

JAVA

Try it !


Posted

in

by

Tags:

Comments

Leave a Reply

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