Class Tile

java.lang.Object
  extended by greenfoot.Actor
      extended by Tile

public class Tile
extends greenfoot.Actor

This is the code for a tile used in the 2048 game. The tile is an image with a number printed on it and a background color To create gaps between tiles, the tile is implemented like a framed picture. The frame will cause the tiles to appear with a gap between them

Version:
2 August 2014
Author:
M. Kadri

Constructor Summary
Tile(int value)
          Constructor
 
Method Summary
 void drawImage()
          Displayes the tile to the screen
 int getHexValue()
          Returns the color of the tile based on the tile value
 
Methods inherited from class
act, addedToWorld, getImage, getIntersectingObjects, getNeighbours, getObjectsAtOffset, getObjectsInRange, getOneIntersectingObject, getOneObjectAtOffset, getRotation, getWorld, getX, getY, intersects, isTouching, move, removeTouching, setImage, setImage, setLocation, setRotation, turn, turnTowards
 
Methods inherited from class
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tile

public Tile(int value)
Constructor

Method Detail

drawImage

public void drawImage()
Displayes the tile to the screen


getHexValue

public int getHexValue()
Returns the color of the tile based on the tile value