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

Tammy/Jessica Final Submission #17

Open
wants to merge 65 commits into
base: jnth/master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
7824610
we succefuly added a 2 into a random available cell
TammyHer Feb 1, 2016
2d473cd
1 out of 10 will be a tile of 4
TammyHer Feb 1, 2016
28e98c2
Move tile left behavior partially working
noglows Feb 1, 2016
22d67f4
fix a bug. noe move left works great
TammyHer Feb 2, 2016
39e52c4
we can move right
TammyHer Feb 2, 2016
563b6e8
we can move down A tile
TammyHer Feb 2, 2016
dd7676c
Added move up functionality
noglows Feb 2, 2016
4119247
Code cleanup
noglows Feb 2, 2016
a713af1
Collide right logic is working
noglows Feb 2, 2016
54da423
we can collide left
TammyHer Feb 2, 2016
be6f8cd
we can collide down
TammyHer Feb 2, 2016
6c22ee6
Collide Up functionality working
noglows Feb 2, 2016
61a10b8
Scoring is working
TammyHer Feb 2, 2016
b303aca
fixed the scoring
TammyHer Feb 2, 2016
8bd0e86
added functiong to check if lost, but havn't tested it yet
TammyHer Feb 2, 2016
ca62542
added lost function- not tested yet
TammyHer Feb 2, 2016
8633bb2
Added move board right function
noglows Feb 2, 2016
d475fc5
function that move the entire board down
TammyHer Feb 2, 2016
f38b2b1
Move board up functionality working
noglows Feb 2, 2016
4dfa951
we have starting point in front end- two random tiles
TammyHer Feb 2, 2016
09fe288
Tiles are moving
noglows Feb 3, 2016
1506ddd
added a left collides- currently not working
TammyHer Feb 3, 2016
6690330
Adding random tile each turn
noglows Feb 3, 2016
7109b36
Merge branch 'jnth/master' of github.com:noglows/2048 into jnth/master
noglows Feb 3, 2016
de687bd
Collision working better for left
noglows Feb 3, 2016
f15ce42
Working on collide left logic
noglows Feb 3, 2016
42a85b6
Added backup file to troubleshoot bugs
noglows Feb 4, 2016
ee80126
File reorg
noglows Feb 4, 2016
698354a
Minor bug fixes
noglows Feb 4, 2016
dce022a
Rewrote move right logic in 2048_2
noglows Feb 4, 2016
c158734
Timing fixes
noglows Feb 4, 2016
8563d3d
Potentially fixed the terrible bug
noglows Feb 4, 2016
7116f2f
Removed console.logs
noglows Feb 4, 2016
52d9ede
the up seems to work
TammyHer Feb 4, 2016
8077655
moving up looks great
TammyHer Feb 4, 2016
5edb8ba
Bug fixing never ends
noglows Feb 4, 2016
5b3c899
Merge branch 'up' into jnth/master
TammyHer Feb 4, 2016
95cfaaf
Merge branch 'jnth/master' of github.com:noglows/2048 into jnth/master
TammyHer Feb 4, 2016
d41011b
Left/Right problems still exist
noglows Feb 4, 2016
4f10cf2
during up-down moving and collide
TammyHer Feb 4, 2016
67481cf
Merge branch 'jnth/master' of github.com:noglows/2048 into jnth/master
TammyHer Feb 4, 2016
d7a2737
Up/Down are functional
noglows Feb 4, 2016
2bc6cb0
Working on movement timing
noglows Feb 4, 2016
9fdc410
Fixed animation bug
noglows Feb 4, 2016
0ae1692
the game looks working
TammyHer Feb 4, 2016
172cc03
Fixed bugs and changed animation times
noglows Feb 4, 2016
815c398
Deleted old files
noglows Feb 4, 2016
e2415be
Reorganized code
noglows Feb 4, 2016
dce088d
Working score bar
noglows Feb 4, 2016
00c22ef
Added a restart button
noglows Feb 4, 2016
514a7be
Small change to scoring
noglows Feb 4, 2016
b8ad93f
fixed a bug
TammyHer Feb 4, 2016
437fa48
Merge branch 'jnth/master' of github.com:noglows/2048 into jnth/master
TammyHer Feb 4, 2016
077368e
Troubleshooting bugs
noglows Feb 5, 2016
2ce3f33
Working game over logic
noglows Feb 5, 2016
bb59f8c
Added winning logic
noglows Feb 5, 2016
4af66e3
Added sweetalert
noglows Feb 5, 2016
7ae0cae
when you move right and nothing is really moving- a new tile wont sho…
TammyHer Feb 5, 2016
9cef641
new random tile wont show up if you cant move
TammyHer Feb 5, 2016
75c4529
add style
TammyHer Feb 5, 2016
df63a90
the game looks fine. no serious bugs
TammyHer Feb 5, 2016
d74062d
Added sweetalert for win and loss
noglows Feb 5, 2016
ae567fa
Updated the winning score
noglows Feb 5, 2016
d923b41
Fixed CSS for the restart button
noglows Feb 5, 2016
0f7f2e5
comment out restart
TammyHer Feb 5, 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
Prev Previous commit
Next Next commit
the game looks fine. no serious bugs
TammyHer committed Feb 5, 2016
commit df63a909c7f7f3ed88e4f6656830884207a92843
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
</head>
<body>
<div class="container"></div>
<h1 >2048</h1>
<h1>2048</h1>
</div>
<h2 id="score">Score: 0</h2>
<a class="restart-button" id="restart">New Game</a>
14 changes: 7 additions & 7 deletions javascripts/2048.js
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ Game.prototype.lost = function() {
}
}
}
console.log(this.board)
alert("Game Over!");
this.restart();
};
@@ -46,7 +47,7 @@ Game.prototype.randTile = function() {
}
}
//console.log(arr)
if (arr.length !== 0) {
//if (arr.length !== 0) {
var randNum = Math.floor((Math.random() * arr.length));
var i_board = arr[randNum][0];
var j_board = arr[randNum][1];
@@ -59,12 +60,11 @@ Game.prototype.randTile = function() {
var val = this.board[i_board][j_board];
$('#gameboard').append('<div class="tile" data-row="r'+i_board+'" data-col="c'+j_board+'" data-val="'+ val +'">'+ val +'</div>');
console.log(arr.length);


} else {
self.lost();
}
//return [i_board, j_board];
if (arr.length <= 1) {
self.lost();
}
//}
//else {console.log(this.board);}
};

Game.prototype.selectTile = function(row, col, value) {
17 changes: 3 additions & 14 deletions stylesheets/2048.css
Original file line number Diff line number Diff line change
@@ -12,14 +12,6 @@ h1 {
font-size: 40px;
}

/*button {
text-align: center;
display: block;
margin: auto;
font-size: 30px;
font: normal normal "Clear Sans", "Helvetica Neue", Arial, sans-serif;
}*/

#gameboard {
background: #bbada0;
border-radius: 0.5rem;
@@ -90,13 +82,10 @@ html, body {
font-size: 18px;
}

h1.title {
font-size: 80px;
font-weight: bold;
margin: 0;
display: block;
float: left;
h1 {
font-size: 70px;
}

.score-container, .best-container {
position: relative;
display: inline-block;