-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
43 lines (37 loc) · 1.31 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
require.config({
paths: {
'cocos2d': '../lib/Cocos2d-html5-canvasmenu',
'domReady': '../lib/domReady'
},
shim: {
'cocos2d': {
exports: 'cc'
}
}
});
require(['domReady', 'cocos2d', 'AppDelegate'], function(domReady, cc) {
'use strict';
domReady(function() {
cc.setup("gameCanvas");
cc.AudioManager.sharedEngine().init("mp3,ogg");
var loader = cc.Loader.shareLoader();
loader.onloading = function() {
cc.LoaderScene.shareLoaderScene().draw();
};
loader.onload = function() {
cc.AppController.shareAppController().didFinishLaunchingWithOptions();
};
loader.preload([
{type: 'image', src: 'resources/beach_bg.png'},
{type: 'image', src: 'resources/beach_fg.png'},
{type: 'image', src: 'resources/jungle_bg.png'},
{type: 'image', src: 'resources/jungle_fg.png'},
{type: 'image', src: 'resources/sleepingSailor.png'},
{type: 'image', src: 'resources/tiles.png'},
{type: 'image', src: 'resources/tiles2.png'},
{type: 'image', src: 'resources/Darwin.png'},
{type: 'tmx', src: 'resources/level0.tmx'},
{type: 'tmx', src: 'resources/level1.tmx'}
]);
});
});