-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
84 lines (76 loc) · 2.7 KB
/
main.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
import recipeBook from './views/recipe-book';
import singleRecipe from './views/single-recipe';
import gameplay from './views/gameplay';
import bonusPopup from './views/bonus-pop-up';
import titleSplash from './views/title-splash-screen';
import App from '~/App';
import * as PIXI from 'pixi.js';
import { objectAtlasInit } from './atlases';
import { foodStack, chefFoodStack } from './store/index';
// Debugging
window.PIXI = PIXI;
const loader = PIXI.loader
//.add('cat', 'images/cat.png')
//.add('door', 'images/door.png')
//.add('images/kitchen.png')
.add('counters', 'images/counters.png')
.add('images/customer1.png')
.add('images/customer2.png')
.add('images/customer3.png')
.add('images/gold.gif')
.add('images/pantry-misc.png')
.add('chef', 'images/chef.png')
.add('images/jollof.png')
.add('images/souschef.png')
.add('images/fryingpan.png')
.add('images/recipebook.png')
.add('images/trashcancopy.png')
.add('images/trashcan2.png')
.add('images/recipeBookInterior.gif')
.add('images/backarrow.svg')
.add('cookedRice', 'images/cooked-riceSM.png')
.add('tomatoPaste', 'images/tomatosauceSM.png')
.add('floor', 'images/floor.png')
.add('playButton', 'images/playButton.png')
.add('flame', 'images/flamesmall.png')
.add('beefSoup', 'images/beef-soupSM.gif')
.add('scallions', 'images/scallionsSM.gif')
.add('noodles', 'images/noodlesSM.gif')
.add('TaiwanNoodles', 'images/TaiwanBeefNoodleSoup.gif')
.add('onion', 'images/onion.gif')
.add('potato', 'images/potato.gif')
.add('Vareniki', 'images/Vareniki.gif')
.add('corn', 'images/corn.gif')
.add('cheese', 'images/cheese.gif')
.add('arepa', 'images/arepa.gif')
.load((loader, resources) => {
objectAtlasInit(resources);
})
.load(singleRecipe)
.load(recipeBook)
.load(gameplay);
// .load(bonusPopup)
// .load(titleSplash);
export const stage = new PIXI.Container();
export const gameStage = new PIXI.Container();
export const recipeBookStage = new PIXI.Container();
export const singleRecipeStage = new PIXI.Container();
stage.addChild(gameStage);
stage.addChild(recipeBookStage);
stage.addChild(singleRecipeStage);
gameStage.addChild(foodStack);
gameStage.addChild(chefFoodStack);
window._stage = stage;
recipeBookStage.visible = false;
singleRecipeStage.visible = false;
const PIXELS_PER_TILE = window.innerWidth / 80;
// stage.scale.x = PIXELS_PER_TILE;
// stage.scale.y = PIXELS_PER_TILE;
export const renderer = PIXI.autoDetectRenderer(window.innerWidth, window.innerHeight);
renderer.view.style.position = 'absolute';
renderer.view.style.display = 'block';
// renderer.resize(10, 100)
renderer.autoResize = false;
// renderer.resize(window.innerWidth, window.innerHeight);
window.R = renderer;
export default loader;