-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9b74d6
commit 2e79612
Showing
15 changed files
with
1,920 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>9007199254740992 | 3kh0</title> | ||
<link href="style/main.css" rel="stylesheet" type="text/css"> | ||
<link href="style/others.css" rel="stylesheet" type="text/css"> | ||
<link rel="shortcut icon" href="favicon.ico"> | ||
<link rel="apple-touch-icon" href="meta/apple-touch-icon.png"> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="HandheldFriendly" content="True"> | ||
<meta name="MobileOptimized" content="320"> | ||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0, maximum-scale=1, user-scalable=no"> | ||
</head> | ||
<script src="/js/main.js"></script> | ||
<body> | ||
<div class="container"> | ||
<div class="heading"> | ||
<h1 class="title">9007199254740992</h1> | ||
<div class="scores-container"> | ||
<div class="score-container">0</div> | ||
<div class="best-container">0</div> | ||
</div> | ||
</div> | ||
<p class="game-intro">Join the numbers and get to the <strong>9007199254740992 tile!</strong></p> | ||
|
||
<div class="game-container"> | ||
<div class="game-message"> | ||
<p></p> | ||
<div class="lower"> | ||
<a class="retry-button">Try again</a> | ||
</div> | ||
</div> | ||
|
||
<div class="grid-container"> | ||
<div class="grid-row"> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
</div> | ||
<div class="grid-row"> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
</div> | ||
<div class="grid-row"> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
</div> | ||
<div class="grid-row"> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
</div> | ||
<div class="grid-row"> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
</div> | ||
<div class="grid-row"> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
</div> | ||
<div class="grid-row"> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
</div> | ||
<div class="grid-row"> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
<div class="grid-cell"></div> | ||
</div> | ||
</div> | ||
|
||
<div class="tile-container"> | ||
|
||
</div> | ||
</div> | ||
|
||
<div class="auto-move-container"> | ||
<p><strong>Move with </strong><input type="text" name="auto-move-time" value="" id="auto-move-input-time" onkeypress='return event.charCode >= 48 && event.charCode <= 57' size="6" maxlength="8"><strong> ms.</strong> <input type="submit" value="Run" id="auto-move-run" class="auto-move-button"> <input type="submit" value="Stop" id="auto-move-stop" class="auto-move-button"></p> | ||
</div> | ||
|
||
<p class="game-explanation"> | ||
<strong class="important">How to play:</strong> Use your <strong>arrow keys</strong> to move the tiles. When two tiles with the same number touch, they <strong>merge into one!</strong> | ||
</p> | ||
<hr> | ||
<p> | ||
<strong class="important">Note:</strong> This site is <font color="red"><strong>not</strong></font> the official version of 2048. You can play the normal version <a href="https://3kh0.github.io/2048/">here!</a> | ||
</p> | ||
|
||
|
||
<hr> | ||
<p> | ||
Orginal 2048 game by <a href="http://gabrielecirulli.com" target="_blank">Gabriele Cirulli.</a><br> | ||
Expanded by <a href="https://github.com/3kh0" target="_blank">3kh0</a><br> | ||
<hr> | ||
|
||
</div> | ||
|
||
<script src="js/animframe_polyfill.js"></script> | ||
<script src="js/keyboard_input_manager.js"></script> | ||
<script src="js/html_actuator.js"></script> | ||
<script src="js/grid.js"></script> | ||
<script src="js/tile.js"></script> | ||
<script src="js/local_score_manager.js"></script> | ||
<script src="js/game_manager.js"></script> | ||
<script src="js/application.js"></script> | ||
<script src="js/auto_move.js"></script> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-98DP5VKS42"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
|
||
gtag('config', 'G-98DP5VKS42'); | ||
</script> | ||
<!--<script>window.scrollTo(0,document.body.scrollHeight);</script>--> | ||
<style> | ||
hr.tw{ | ||
border-color: blue; | ||
} | ||
</style> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
(function() { | ||
var lastTime = 0; | ||
var vendors = ['webkit', 'moz']; | ||
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { | ||
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; | ||
window.cancelAnimationFrame = | ||
window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; | ||
} | ||
|
||
if (!window.requestAnimationFrame) { | ||
window.requestAnimationFrame = function(callback, element) { | ||
var currTime = new Date().getTime(); | ||
var timeToCall = Math.max(0, 16 - (currTime - lastTime)); | ||
var id = window.setTimeout(function() { callback(currTime + timeToCall); }, | ||
timeToCall); | ||
lastTime = currTime + timeToCall; | ||
return id; | ||
}; | ||
} | ||
|
||
if (!window.cancelAnimationFrame) { | ||
window.cancelAnimationFrame = function(id) { | ||
clearTimeout(id); | ||
}; | ||
} | ||
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var GM; | ||
|
||
// Wait till the browser is ready to render the game (avoids glitches) | ||
window.requestAnimationFrame(function () { | ||
GM = new GameManager(8, KeyboardInputManager, HTMLActuator, LocalScoreManager); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
var auto_move_flag = false; | ||
var auto_move_time; | ||
|
||
function start_auto_move(){ | ||
auto_move_flag = true; | ||
auto_move(); | ||
} | ||
|
||
function auto_move(){ | ||
if ( auto_move_flag === false ) | ||
return; | ||
var direction = Math.floor( Math.random() * 4 ); | ||
GM.move( direction ); | ||
setTimeout( "auto_move()", auto_move_time ); | ||
} | ||
|
||
function stop_auto_move(){ | ||
auto_move_flag = false; | ||
} | ||
|
||
window.requestAnimationFrame(function(){ | ||
document.getElementById("auto-move-run").addEventListener("click",function(){ | ||
var time = parseInt( document.getElementById("auto-move-input-time").value ); | ||
if ( !isNaN( time ) ){ | ||
auto_move_time = time; | ||
if ( auto_move_flag === false ){ | ||
start_auto_move(); | ||
} | ||
} | ||
}); | ||
document.getElementById("auto-move-stop").addEventListener("click",function(){ | ||
stop_auto_move(); | ||
}); | ||
}); |
Oops, something went wrong.