-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
152 lines (131 loc) · 5.24 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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Dictatorship!</title>
<!--Yi: Please put our JS files here just like the #include thing in C++/C-->
<!--Yi: Here are the include files for Phaser and FMOD. -->
<script src="//cdn.jsdelivr.net/phaser/2.2.2/phaser.min.js"></script>
<!-- <script type="text/javascript" src="fmod.js"></script>
<script type="text/javascript" src="WebGLFilters.js"></script> -->
<script type="text/javascript" src="BetweenTurnEvents.js"></script>
<script type="text/javascript" src="Board.js"></script>
<script type="text/javascript" src="BoardController.js"></script>
<script type="text/javascript" src="Building.js"></script>
<script type="text/javascript" src="BuildMenu.js"></script>
<script type="text/javascript" src="BuildingDetail.js"></script>
<script type="text/javascript" src="CoalitionFlag.js"></script>
<script type="text/javascript" src="CoalitionQuest.js"></script>
<script type="text/javascript" src="Contract.js"></script>
<script type="text/javascript" src="DDecisionView.js"></script>
<script type="text/javascript" src="DListView.js"></script>
<script type="text/javascript" src="DossierMenu.js"></script>
<script type="text/javascript" src="DPageIndicator.js"></script>
<script type="text/javascript" src="DragableSprite.js"></script>
<script type="text/javascript" src="DReminderView.js"></script>
<script type="text/javascript" src="DUiMask.js"></script>
<script type="text/javascript" src="Event.js"></script>
<script type="text/javascript" src="UnitAI.js"></script>
<script type="text/javascript" src="Unit.js"></script>
<script type="text/javascript" src="Global.js"></script>
<script type="text/javascript" src="MainGame.js"></script>
<script type="text/javascript" src="Notification.js"></script>
<script type="text/javascript" src="MenuElements.js"></script>
<script type="text/javascript" src="MoneyPanel.js"></script>
<script type="text/javascript" src="FunPanel.js"></script>
<script type="text/javascript" src="YearView.js"></script>
<script type="text/javascript" src="FinanceView.js"></script>
<script type="text/javascript" src="PrivateAccountView.js"></script>
<script type="text/javascript" src="UI.js"></script>
<script type="text/javascript" src="UiTest.js"></script>
<script type="text/javascript" src="People.js"></script>
<script type="text/javascript" src="PeopleContractView.js"></script>
<script type="text/javascript" src="PeopleView.js"></script>
<script type="text/javascript" src="PopulationMenus.js"></script>
<script type="text/javascript" src="Preloader.js"></script>
<script type="text/javascript" src="Sound.js"></script>
<script type="text/javascript" src="Telemetry.js"></script>
<script type="text/javascript" src="TileInfoView.js"></script>
<script type="text/javascript" src="Tutorial.js"></script>
<script type="text/javascript" src="updateHomes.js"></script>
<!-- Yi: Please put our custome font files here BELOW the my font face line of myKaiti -->
<style type="text/css">
.fontLoader {
position: absolute;
left: -1000px;
visibility: hidden;
}
body {
margin: 0;
}
@font-face {font-family: 'myKaiti'; src: url("images/STKaiTi.ttf") format('truetype');}
</style>
</head>
<body>
<!-- Yi: force it to load the font. We should replace it with a custom loader/GameState -->
<div class="fontLoader" style="font-family: 'myKaiti';">-</div>
<script type="text/javascript">
// the game variable
var game=null;
// set if we need the sound
var needSound=false;
if(needSound){
/*global Sound*/
Sound.init(PhaserSetup);
// do other things if necessary
}else{
PhaserSetup();
// do other things if necessary
}
function PhaserSetup(){
/*global Phaser*/
game = new Phaser.Game(1280, 720, Phaser.AUTO, '',
{init:init, preload: preload, create: create, update: update});
}
function init(){
// let's add a function to Phaser's Group
Phaser.Group.prototype.findChild=function(name){
console.log("Find: "+name+ " in: "+this.name);
if(this.name && this.name===name)
return this;
if(!this.children || !this.children.length)
return false;
var childrenCount=this.children.length;
for(var i=0;i<childrenCount;i++){
var ch=this.getChildAt(i);
if(!ch.children || !ch.children.length ||!ch.findChild)
continue;
var res=ch.findChild(name);
if(res)
return res;
}
return false;
};
}
function preload() {
/*global Preloader*/
Preloader.preload(game);
/*global MainGame*/
MainGame.init(game);
}
function create() {
/*global MainGame*/
MainGame.start();
// for test
MainGame.board.cameraCenterOn(82);
MainGame.board.cameraZoomAt();
/*global UiTest*/
// UiTest.init(game);
// play bgm
// Sound.playSound(0);
// UNIT TEST: decision view
// test_DDecisionView();
// test_Event();
// UNIT TEST: coalition_quest
// test_coalition_quest();
}
function update() {
}
</script>
</body>
</html>