-
Notifications
You must be signed in to change notification settings - Fork 4
/
is_it_equal_lightning.html
77 lines (61 loc) · 2.35 KB
/
is_it_equal_lightning.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
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>Experiment Factory Game</title>
<script src='https://cdnjs.cloudflare.com/ajax/libs/phaser/2.4.6/phaser.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.0/jquery.min.js'></script>
<script src='static/games/is_it_equal_lightning/box2d-plugin-full.min.js'></script>
<script src='static/games/is_it_equal_lightning/Boot.js'></script>
<script src='static/games/is_it_equal_lightning/Preloader.js'></script>
<script src='static/games/is_it_equal_lightning/Menu.js'></script>
<script src='static/games/is_it_equal_lightning/Instructions.js'></script>
<script src='static/games/is_it_equal_lightning/Run.js'></script>
<script src='static/games/is_it_equal_lightning/problems.js'></script>
</head>
<body>
<script type="text/javascript">
this.data = {}
this.taskdata = []
function inputData(field, value) {
this.data[field] = value
}
function sendData(trial) {
inputData('trial', trial)
this.taskdata.push(this.data);
if (data.finished == 1) {
setTimeout(function() {
var data = "text/json;charset=utf-8," + JSON.stringify(this.taskdata);
var a = document.createElement('a');
a.title = "Download"
a.id = "download"
a.type = "button"
a.download = 'expfactory_result.json';
a.href = 'data:' + data;
$("#finished").show();
$("#download").click(function(){
$("body").append(a)
a.click()
})
},2000)
}
this.data = {};
}
window.onload = function() {
//create the game and the game states
var game = new Phaser.Game(960, 600, Phaser.CANVAS, 'gameContainer')
problem_set='A'
game.state.add('Boot', Game.Boot)
game.state.add('Preloader', Game.Preloader)
game.state.add('Menu',Game.Menu)
game.state.add('Instructions', Game.Instructions)
game.state.add('Run', Game.Run)
//Now start the Boot state.
game.state.start('Boot', true, false, problem_set)
}
</script>
<div id="finished" hidden>
<button id="download" type="button" style="background-color:white;padding:10px; border-radius:5px">Download</button>
</div>
</body>
</html>