A 2048 clone using processing. User Interface Programming II Uppsala University
class gameBoard?
class Cell (x, y, widht, height)
class Tile (x, y, z, width, heigh, value, color)
Basic functon either for each tile or for the board. moveUp() moveDown() moveRigh() moveLeft()
Algorithm
-
Assign a random variable for value
-
drag up, down, left or right
2.1 For each cell check if it can move or not.
2.1.1 else move until it hits a tile or the border