-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
49 lines (43 loc) · 1.11 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
import Framework, { scene } from 'froobit';
import BackgroundController from './src/client/controller/BackgroundController';
import BirdController from './src/client/controller/BirdController';
import PlatformController from './src/client/controller/PlatformController';
import ScoreController from './src/client/controller/ScoreController';
import Layers from './src/client/layers';
// assets
import bg1 from './assets/bg1.jpg';
import bg2 from './assets/bg2.png';
import bg3 from './assets/bg3.png';
import bg4 from './assets/bg4.png';
import bird from './assets/bird.png';
import platform from './assets/platform.png';
import font from './assets/customFont.otf';
import GameOverLabelController from './src/client/controller/GameOverLabelController';
// Entry point
const assets = {
images: {
bg1,
bg2,
bg3,
bg4,
bird,
platform,
},
fonts: {
font,
},
};
const controllers = [
BackgroundController,
BirdController,
PlatformController,
ScoreController,
GameOverLabelController,
];
const options = {
assets,
scene: scene(400, 600),
physics: true,
layers: Layers,
};
Framework.with(controllers, options).init();