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

2048! #11

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,41 @@ Recreate as much of the original game as is reasonable in the one week we have a
### Project Baseline
- Play a couple games of [2048](http://gabrielecirulli.github.io/2048/). Think about everything that's likely happening in the code to support what's happening on the screen. Once you've got a feel for the game, talk with your pair and answer the following questions:
1. How does scoring work?

When you collide 2 equivalent tiles together, their value is added to the score.

1. When do tiles enter the game?

The game starts with 2 tiles in a random location. New tiles enter the game whenever you swipe. There is a 90% chance the tile will be the number 2, and a 10% chance that it will be the number 4.

1. How do you know if you've won?

When at least one tile's value is 2048.

1. How do you know if you've lost?

When there are no more empty spaces on the grid.

1. What makes tiles move?

Arrow keys.

1. What happens when they move?

The tile's old location becomes empty and its destination space's value is updated with that tile's value.

1. How would you know how far a tile should move?

A tile can only move up to 3 spaces up, down, right, or left. If there's a tile in the way that doesn't have the same value, the tile is blocked by it. A tile always moves the length of empty spaces; it cannot move just one space at a time.

1. How would you know if tiles would collide?

Tiles collide when their value is the same.

1. What happens when tiles collide?

The destination tile becomes the sum of the source tile + the destination tile. The source tile then disappears.

- Document your answers to these questions in this README.
- Use your discussion and answers to create tasks for a trello board. Organize those tasks into deliverable components (e.e., _Scoring_, _Tile Collision_, _Win/Loss_).
- Open a PR with your discussion notes and answers to the above questions. Include a link to your Trello board. Indicate in the PR which deliverable(s) you are targeting first.
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<head>
<title>2048</title>
<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="http://code.jquery.com/jquery-2.1.4.js"></script>
<script type="text/javascript" src="javascripts/2048.js"></script>
</head>
<body>
<div id="message"></div>
Score: <div id="score">0</div>
<button name="restart">Restart</button>
<div id="gameboard">
<div class="cells">
<div class="cell"></div>
Expand All @@ -26,7 +29,7 @@
<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="r3", data-col="c3" data-val="2">2</div>
</div>
</body>
</html>
Loading