-
Notifications
You must be signed in to change notification settings - Fork 2
/
Kitchen.js
297 lines (228 loc) · 4.52 KB
/
Kitchen.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
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
//Developer: Christina Beckford
//Logic For Food Objects and Kitchen tools
//Logic to progress from level 1 to Level 3
//Logic to place orders and handle custoemrs orders
//Level 1-3
//Sets the canvas of the game
var config = {
type:Phaser.AUTO,
width: 800,
height: 600,
physics: {
default: 'arcade',
arcade: {
gravity: {y:300},
debug: false
}
},
//Loads the screens for the game
scene: {
preload: preload,
create: create,
update: update
}
};
//Level 1 Gameplay # of customers
var customer1 = {
coins : 100,
moneyRecieved: false,
foodSelection,
};
var customer2 = {
coins = 100,
moneyRecieved: false,
foodSelection,
};
var customer3 = {
coins = 100,
moneyRecieved: false,
foodSelection,
};
//Level 2 Gameplay # of customers
var customer4 ={
coins =300,
moneyRecieved: false,
foodSelection,
};
var customer5 ={
coins =300,
moneyRecieved: false,
foodSelection,
};
var customer6 ={
coins =300,
moneyRecieved: false,
foodSelection,
};
//Level 3 Gameplay
var customer7 ={
coins = 500,
moneyRecieved: false,
foodSelection,
};
var customer8 ={
coins = 500,
moneyRecieved: false,
foodSelection,
};
var customer9 ={
coins =500,
moneyRecieved: false,
foodSelection,
};
//Food Items
var chickenSandwich ={
cost :10,
onPlate: true,
};
var hamburger= {
isCooked: false,
onBun : true,
onSkillet: true,
cost = 20
};
var salad = {
cost : 25,
inBowl: true,
};
var bbqribs = {
cost : 50,
isCooked: true,
onPlate: true,
};
var Coffee = {
cost : 15,
isFull: true,
};
var Cola = {
cost : 10,
isFull: true,
};
var Donut ={
onPlate: true
};
//Kitchen tools
var Skillet = {
isCooked : false,
onBun :false,
time =10,
},
var Plate = {
isFooditemOnPlate :false,
}
var Cup = {
isFull : true,
isCupAtDispenser: false,
}
var Bowl = {
isFooditemOnBowl : false,
}
var Grill ={
isFooditemOnGrill: false,
cookingTime()
};
function cookingTime(chickenSandwich)
{
{
var timeleft = 10,
var cooktime = setInterval(function(){
if(timeleft <=0){
clearInterval(cooktime);
}
document.getElementById("progressBar").value = 10 -timeleft;
timeleft -=1;
}, 1000);
}
function cookingTime(hamburger)
{
{
var timeleft = 10,
var cooktime = setInterval(function(){
if(timeleft <=0){
clearInterval(cooktime);
}
document.getElementById("progressBar").value = 10 -timeleft;
timeleft -=1;
}, 1000);
}
function placeOrder()
{
}
function collectMoney(coins)
{
if(moneyRecieved == true)
{
totalUserMoney = coins++;
}
}
function orderFood(customer)
{
if(customerOrder == chickenSandwich)
{
}
}
//Payment For Food Orders
if(foodSelection == chickenSandwich )
{
if(onPlate == true)
{
//customer pays value of chicken sandwich
}
}
if(foodSelection == Donut)
{
if(onPlate == true)
{
//customer pays value of donut
}
}
if(foodSelection == bbqribs )
{
if(onPlate == true && isCooked == true)
{
//customer pays value of bbqribs
}
}
if(foodSelection == salad )
{
if(inBowl == true)
{
//customer pays value of salad
}
}
if(foodSelection == Coffee)
{
if(isFull == true)
{
//customer pays value of coffee
}
}
//Progression of Levels 1 -3 Depending On Amount of Money Is Accumlated Per Level
var level1 ={
TotalAmountToMake:200,
};
var level2 ={
TotalAmountToMake:1000,
};
var level3 ={
TotalAmountToMake: 2000,
};
var userTotal = 0;
while(userTotal !=0)
{
if(userTotal ==200)
{
//moves on to level 2
}
else(userTotal <200) { //keep recieving orders from custoemrs}
if(userTotal == 1000)
{
//moves on to level 3
}
else(userTotal < 1000){//keep recieving orders from customers on level 2}
if(userTotal == 2000)
{
//Game over render the leadership board
}
else(userTotal <2000){//keep recieving orders}
};