Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull Request for 2048 Game #16

Open
wants to merge 49 commits into
base: mmrdfp/master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a3f0ca4
Pressing up arrow moves tile up one cell
knaydee Feb 2, 2016
b4d671e
Tile can move down, fix so up and down movement can not be out out of…
dezshino Feb 2, 2016
5bc06bd
Tile can move left and right
dezshino Feb 2, 2016
b596e99
put tile directions in for loops for later additions of tiles
dezshino Feb 2, 2016
acbbac5
Storing tile data-row attribute in array
knaydee Feb 2, 2016
089d1b0
Storing tile data-col attribute in array
knaydee Feb 2, 2016
7ff78bb
Separate getting tile positions into its own function
dezshino Feb 2, 2016
06febd0
Start with empty board array
dezshino Feb 2, 2016
5697970
Start planning random tile function
dezshino Feb 2, 2016
07c41f4
Put all 0s in the board in an array
knaydee Feb 2, 2016
869ee6b
addRandomTile function chooses the index of one of the empty 0 spots …
dezshino Feb 2, 2016
35273e7
Randomly select a 2 or 4 to assign to the empty position in the board
dezshino Feb 2, 2016
a399073
Update comments
dezshino Feb 2, 2016
0c5c1f3
moveLeft function gets hit when called within moveTile function
knaydee Feb 2, 2016
59bd5c3
Moves value over one if space before is 0
dezshino Feb 2, 2016
dce726a
Clean up code, add comments, refactor
dezshino Feb 3, 2016
f0679b6
Refactor, tile can move left
dezshino Feb 3, 2016
902809e
Initialize gameboard with 2 randomly placed tiles
dezshino Feb 3, 2016
17de617
Adds a random tile after moving left
dezshino Feb 3, 2016
858c96d
Add moveRight function for tiles
dezshino Feb 3, 2016
027118f
moveUp function works
knaydee Feb 3, 2016
dd37c09
addRandomTile to case 38 in moveTile
knaydee Feb 3, 2016
3058004
Add addRandTile method to be after any keystroke
dezshino Feb 3, 2016
8e0117e
Empty displayBoard method started
dezshino Feb 3, 2016
bbe1bff
Add tile collision cases to moveLeft function, works in all cases exc…
dezshino Feb 4, 2016
cac4df4
jquery for random tiles at start of game
knaydee Feb 4, 2016
53456b1
jquery for moveTile function
knaydee Feb 4, 2016
e12b246
Rebuilt moveLeft function, it now works for the 2420 pattern
dezshino Feb 4, 2016
ffc2ac4
Merge branch 'mmrdfp/master' of github.com:desireepoland/2048 into mm…
dezshino Feb 4, 2016
039a9e5
put comments to the right
dezshino Feb 5, 2016
51cf1ef
Refactor moveLeft function
dezshino Feb 5, 2016
1c7ede0
Add moveRight function, still working on merging over two 0s, added c…
dezshino Feb 5, 2016
d4edc98
Bug fix, fixed the 2240 cases in moveLeft abd moveRight
dezshino Feb 5, 2016
af9e73b
Bug fix for 2002 pattern cases. moveLeft and moveRight seem to fully …
dezshino Feb 5, 2016
44c8863
Change background color
dezshino Feb 5, 2016
7445c69
Add moveUp function
dezshino Feb 5, 2016
2f94c75
Add moveDown function
dezshino Feb 5, 2016
72ab836
Set initial score to 0 and gameOver to false
dezshino Feb 5, 2016
db112f7
Set gameOver to true if board filled, no random tiles added if gameOver
dezshino Feb 5, 2016
475ee98
Change order for initialized game so the initial 2 tiles appear
dezshino Feb 5, 2016
17bc38d
Add addToScore method, use it after every merge/collision
dezshino Feb 5, 2016
61d4fd2
Started building endGame function
dezshino Feb 5, 2016
253d28f
Add display board method, works but grid disappears
dezshino Feb 5, 2016
4535c96
Fixed grid disappearance issue
dezshino Feb 5, 2016
f798aba
change gameOver to boardFull for more clarity
dezshino Feb 5, 2016
5d22da2
Game win or lose logic
knaydee Feb 5, 2016
2915cb8
Add sweet alerts when game is over
dezshino Feb 5, 2016
682c549
Add a title
dezshino Feb 5, 2016
794fc8d
Add status images to alerts
dezshino Feb 6, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
<link rel="stylesheet" media="all" href="stylesheets/2048.css"/>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="javascripts/2048.js"></script>
<script src="node_modules/sweetalert/dist/sweetalert.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Droid+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="node_modules/sweetalert/dist/sweetalert.css">
</head>
<body>
<h1>2048</h1>
<div id="gameboard">
<div class="cells">
<div class="cell"></div>
Expand All @@ -26,7 +30,8 @@
<div class="cell"></div>
<div class="cell"></div>
</div>
<div class="tile" data-row="r1", data-col="c1" data-val="2">2</div>
<!-- <div class="tile" data-row="r1", data-col="c1" data-val="2">2</div>
<div class="tile" data-row="r2", data-col="c2" data-val="4">4</div> -->
</div>
</body>
</html>
Loading