-
Notifications
You must be signed in to change notification settings - Fork 1
/
botsplay.html
159 lines (121 loc) · 4.09 KB
/
botsplay.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>IVO INFO 2024</title>
<meta name="description" content="Blockrain.js lets you embed the classic Tetris game on your website" />
<meta name="keywords" content="js, jquery, game, plugin, html5, tetris" />
<meta name="robots" content="INDEX, FOLLOW" />
<meta name="author" content="Info ORT" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui" />
<link rel="shortcut icon" href="assets/images/ico.ico" />
<link href='http://fonts.googleapis.com/css?family=Play:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="assets/css/style.css">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-21195039-3', 'aerolab.github.io');
ga('require', 'displayfeatures');
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');
</script>
</head>
<body>
<section id="versus">
<header>
<!-- Título de la página -->
<h1>Deja que los robots jueguen entre si</h1>
</header>
<article id="versus-arena">
<div class="game-holder" id="tetris-versus-1">
<div class="score">0</div>
<div class="game"></div>
</div>
<div class="game-holder" id="tetris-versus-2">
<div class="score">0</div>
<div class="game"></div>
</div>
</article>
</section>
<!--section class="play">
<h1>Play</h1>
<div class="game" id="tetris-play">
</div>
</section-->
<footer id="footer">
<div class="buttons">
<a href="index.html" class="btn btn-download"><img src="assets/images/game-icon.png" alt="Play">Jugá</a>
</footer>
<script src="assets/js/jquery-1.11.1.min.js"></script>
<script src="src/blockrain.jquery.libs.js"></script>
<script src="src/blockrain.jquery.src.js"></script>
<script src="src/blockrain.jquery.themes.js"></script>
<script>
var $cover = $('#cover-tetris').blockrain({
autoplay: true,
autoplayRestart: true,
speed: 100,
autoBlockWidth: true,
autoBlockSize: 25,
theme: 'candy'
});
var versusSpeed = 5;
var $versus1 = $('#tetris-versus-1 .game').blockrain({
autoplay: true,
autoplayRestart: true,
speed: versusSpeed,
onGameOver: function() {
$versus1.blockrain('restart');
$versus2.blockrain('restart');
var $score = $versus2.parent().find('.score');
$score.text( parseInt($score.text()) + 1 );
}
});
var $versus2 = $('#tetris-versus-2 .game').blockrain({
autoplay: true,
autoplayRestart: true,
speed: versusSpeed,
onGameOver: function() {
$versus1.blockrain('restart');
$versus2.blockrain('restart');
var $score = $versus1.parent().find('.score');
$score.text( parseInt($score.text()) + 1 );
}
});
var $demo = $('#tetris-demo').blockrain({
speed: 20,
theme: 'vim',
onStart: function() {
ga( 'send', 'event', 'tetris', 'started');
},
onLine: function() {
ga( 'send', 'event', 'tetris', 'line');
},
onGameOver: function(score){
ga( 'send', 'event', 'tetris', 'over', score);
}
});
$('#example-slider').find('.btn-next').click(function(event){
event.preventDefault();
switchDemoTheme(true);
});
$('#example-slider').find('.btn-prev').click(function(event){
event.preventDefault();
switchDemoTheme(false);
});
function switchDemoTheme(next) {
var themes = Object.keys(BlockrainThemes);
var currentTheme = $demo.blockrain('theme');
var currentIx = themes.indexOf(currentTheme);
if( next ) { currentIx++; }
else { currentIx--; }
if( currentIx >= themes.length ){ currentIx = 0; }
if( currentIx < 0 ){ currentIx = themes.length-1; }
$demo.blockrain('theme', themes[currentIx]);
$('#example-slider .theme strong').text( '"'+themes[currentIx]+'"' );
}
</script>
</body>
</html>