Repository navigation
Expand file tree
/
Copy pathgame.js
More file actions
108 lines (95 loc) · 2.73 KB
/
Copy pathgame.js
File metadata and controls
108 lines (95 loc) · 2.73 KB
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
(function (Crafty, window, document) {
window.onload = function() {
Crafty.init();
if (Crafty.storage) Crafty.storage.open("ArTonelicoLunar01");
Crafty.data.externalURL = 'http://www.guneva.net/artonelico/data.php';
Crafty.scene('intro', function() {
// load any global game data
// play opening video
// begin loading of most-used assets (playable character spritemaps, UI backrounds, etc)
var interrupt = Crafty.e('Keyboard').bind('KeyDown', function () {
Crafty.view('gameMenu');
this.destroy();
});
Crafty.data.prepare('combat', 'combat.rous');
Crafty.data.prepare('combat', 'combat.sera');
Crafty.data.prepare('combat', 'combat.tahna');
Crafty.data.prepare('combat', 'combat.berix');
Crafty.data.prepare('combat', 'combat.ceyna');
Crafty.data.prepare('combat', 'combat.hara');
Crafty.data.prepare('combat', 'combat.stacca');
Crafty.data.prepare('combat', 'combat.forst');
Crafty.data.prepare('scene', 'phase01.000');
});
Crafty.view('gameMenu', {
create: function() {
// options:
// New Game
// Load Game
// Settings
// Extras
var view = this,
width = 100,
height = (25 + 5) * 5,
start = {w: width, h: height, x: Crafty.viewport.width/2 - width/2, y: Crafty.viewport.height - height},
menus = "\r\n";
menus += " <ul class=\"menu_main\">\r\n";
menus += " <li id=\"continue\">Continue</li>\r\n";
menus += " <li id=\"new_game\">New Game</li>\r\n";
menus += " <li id=\"load_game\">Load Game</li>\r\n";
menus += " <li id=\"settings\">Settings</li>\r\n";
menus += " <li id=\"extras\">Extras</li>\r\n";
menus += " </ul>";
Crafty.e("HTML, Mouse")
.replace(menus)
.attr(start)
.attr({_element: this._element})
.bind('Click', function (e) {
switch (e.target.id) {
case 'continue':
Crafty.storage.load('last_game', 'cache', function (data) {
this.deactivate();
// load game
});
break;
case 'new_game':
this.deactivate();
Crafty.get('cutscene', 'scene_00').play();
break;
case 'load_game':
Crafty.view('saveLoad', 'slideUp');
break;
case 'settings':
Crafty.scene('gameSettings');
break;
case 'extras':
Crafty.view('extras', 'slideUp');
break;
}
});
},
});
Crafty.view('saveLoad', {
});
Crafty.scene('gameSettings', function() {
});
Crafty.view('combat', {
create: function() {
this.addComponent('CombatEngine Cutscene');
},
start: function() {
this.startCombat();
},
stop: function() {
this.endCombat();
}
});
Crafty.view('explore', {
});
Crafty.view('userMenu', {
});
Crafty.view('extras', {
});
Crafty.scene('intro');
}
})(Crafty, window, window.document);