forked from DaRaFF/jsTetrisGameJs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
63 lines (59 loc) · 2.62 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html><!--HTML5 doctype-->
<html>
<head>
<title>Tetris Engine</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name = "viewport" content = "user-scalable=no, width=device-width">
<script type="text/javascript" charset="utf-8" src="http://localhost:58888/_appMobi/appmobi.js"></script>
<script type="text/javascript">
/* This code prevents users from dragging the page */
var preventDefaultScroll = function(event) {
event.preventDefault();
window.scroll(0,0);
return false;
};
/* This code is used to run as soon as appMobi activates */
var onDeviceReady=function(){
//Size the display to 768px by 1024px
AppMobi.display.useViewport(screen.width,screen.width);
};
</script>
</head>
<body>
<!-- <div id="info">
<canvas id="next_shape"></canvas>
<p id="level">Level: <span></span></p>
<p id="lines">Lines: <span></span></p>
<p id="score">Score: <span></span></p>
<p id="time">Time: <span></span></p>
</div>-->
<canvas id='canvas'></canvas>
<script src='lib/Stats.js'></script>
<script src='js/Tetris.js'></script>
<script src='js/Tetris.Timer.js'></script>
<script src='js/Tetris.Player.js'></script>
<script src='js/Tetris.Block.js'></script>
<script src='js/Tetris.Block.Elements.js'></script>
<script src='js/Tetris.Block.Factory.js'></script>
<script src='js/Tetris.Map.js'></script>
<script src='js/Tetris.command.js'></script>
<script src='js/engine.js'></script>
<script src='js/engine.loop.js'></script>
<script src='js/engine.stats.js'></script>
<script src='js/engine.input.js'></script>
<script src='js/engine.screen.js'></script>
<link rel='stylesheet' href='style.css' media='all' />
<script>
//mobile
document.addEventListener("appMobi.device.ready",onDeviceReady,false);
document.addEventListener('touchmove', preventDefaultScroll, false);
window.addEventListener('touchstart', engine.input.parseTouchInput, false);
//keyboard
window.addEventListener('keydown', engine.input.parseKeyboardInput, false);
//start
window.addEventListener('load', function(){
engine.start();
}, false);
</script>
</body>
</html>