java.lang.Objectgreenfoot.Actor
Tile
public class Tile
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
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 |
---|
public Tile(int value)
Method Detail |
---|
public void drawImage()
public int getHexValue()