-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfarm.js
120 lines (79 loc) · 3.16 KB
/
farm.js
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
"use strict";
var farm = function($) {
return {
config : {
width : 1280,
height : 720
},
/**
* Initializes game
*/
initialize : function() {
// init Crafty
Crafty.init(this.config.width, this.config.height);
Crafty.canvas.init();
// set bacgroundd
Crafty.background("url('images/background.png')");
// Run intro
Crafty.scene("intro");
// load main sprite sheet
Crafty.sprite(5, "images/menu_sprite.png", {
//Titles
logoText : [0, 90, 106, 25],
setupTitle : [156, 0, 100, 20],
roleTitle : [0, 116, 27, 26],
goalTitle : [0, 176, 70, 20],
// Reusable Elements
menuBtn : [0, 0, 50, 20],
squareBtn : [106, 0, 20, 20],
backArrow : [126, 0, 20, 20],
exitBtn : [50, 116, 20, 20],
blueCircle : [207, 90, 16, 20],
greenCircle : [223, 90, 16, 20],
modalWindow : [106, 110, 150, 90],
startText : [156, 46, 50, 20],
//Menu text
playText: [0, 24, 50, 20],
setupText: [0, 46, 50, 20],
loadText : [0, 68, 50, 20],
scenariosText : [106, 24, 50, 20],
//Setup Screen Stuff
govtIcon : [60, 136, 20, 20],
condIcon : [40, 136, 20, 20],
timeIcon : [20, 136, 20, 20],
natIcon : [0, 136, 20, 20],
loadscText : [206, 46, 50, 20],
saveText : [106, 46, 50, 20],
govtText : [106, 68, 50, 6],
condText : [156, 68, 50, 6],
natText : [206, 24, 50, 6],
timeText : [206, 68, 50, 6],
breakLine : [90, 44, 88, 1],
text1 : [156, 32, 88, 12],
text2 : [156, 20, 88, 12],
text3 : [0, 116, 20, 12 ],
//Set End Goals Screen
happinessIcon : [40, 156, 16, 20],
cornIcon : [20, 156, 20, 20],
gdpIcon : [0, 156, 20, 20],
loadgText : [106, 90, 50, 20],
savegText : [156, 90, 50, 50],
happinessText : [0, 116, 50, 6],
cornText : [156, 24, 50, 6],
gdpText : [206, 68, 50, 6],
slider : [0, 0, 50, 4],
});
// load game scene sprite
Crafty.sprite(5, "images/game_components.png", {
plusButton : [0, 0, 20, 20],
timelineBackground : [20, 12, 144, 5],
timelineSelected : [20, 4, 144, 5],
taxMark : [4, 4, 100, 5],
subsidyMark : [35, 4, 100, 5],
playButton: [20, 20, 20, 20],
pauseButton : [0, 20, 20, 14],
backButton : [0, 34, 6, 6],
});
}
};
}($);