147 lines
6.8 KiB
JavaScript
147 lines
6.8 KiB
JavaScript
var Loading = {
|
|
|
|
preload: function() {
|
|
// game.load.image('loadingbar', './image/phaser.png');
|
|
},
|
|
|
|
create: function() {
|
|
// var userID = sessionStorage.getItem("UserID");
|
|
// console.log("userID : " + userID);
|
|
|
|
// game.stage.backgroundColor = '#4d4d4d';
|
|
|
|
// // Progress report
|
|
// this.textProgress = game.add.text(game.world.centerX, 100, '로딩중 . . .', textStyleBasic);
|
|
// this.textProgress.anchor.setTo(0.5, 0.4);
|
|
// this.textProgress.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
|
|
|
// // Preload bar
|
|
// this.preloadBar = this.add.sprite(game.world.centerX, game.world.centerY, 'loadingbar');
|
|
// this.preloadBar.anchor.setTo(0.5);
|
|
// this.preloadBar.alpha = 0;
|
|
|
|
game.load.onFileComplete.add(this.fileComplete, this);
|
|
game.load.onLoadComplete.add(this.loadComplete, this);
|
|
|
|
this.startLoading();
|
|
},
|
|
|
|
startLoading: function() {
|
|
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
|
|
|
|
game.load.image('wooden_table', '../../../resources/image/object/grilled_meat/wooden_table.png');
|
|
|
|
game.load.image('stove_dial', '../../../resources/image/object/grilled_meat/stove_dial.png');
|
|
game.load.image('stove_dial_dot', '../../../resources/image/object/grilled_meat/stove_dial_dot.png');
|
|
|
|
game.load.image('plate', '../../../resources/image/object/grilled_meat/plate.png');
|
|
|
|
game.load.image('heat_plate_flame', '../../../resources/image/object/grilled_meat/heat_plate_flame.png');
|
|
game.load.image('heat_plate', '../../../resources/image/object/grilled_meat/heat_plate.png');
|
|
|
|
game.load.image('trash_can', '../../../resources/image/object/grilled_meat/trash_can.png');
|
|
|
|
game.load.image('meat1', '../../../resources/image/object/grilled_meat/meat1.png');
|
|
game.load.image('meat_welldone1', '../../../resources/image/object/grilled_meat/meat1_welldone.png');
|
|
game.load.image('meat_burn1', '../../../resources/image/object/grilled_meat/meat1_burn.png');
|
|
|
|
game.load.image('meat2', '../../../resources/image/object/grilled_meat/meat2.png');
|
|
game.load.image('meat_burn2', '../../../resources/image/object/grilled_meat/meat2_burn.png');
|
|
game.load.image('meat_welldone2', '../../../resources/image/object/grilled_meat/meat2_welldone.png');
|
|
|
|
game.load.image('meat3', '../../../resources/image/object/grilled_meat/meat3.png');
|
|
game.load.image('meat_welldone3', '../../../resources/image/object/grilled_meat/meat3_welldone.png');
|
|
game.load.image('meat_burn3', '../../../resources/image/object/grilled_meat/meat3_burn.png');
|
|
|
|
game.load.image('bonus_meat', '../../../resources/image/object/grilled_meat/meat_bonus.png');
|
|
game.load.image('bonus_meat_welldone', '../../../resources/image/object/grilled_meat/meat_bonus_welldone.png');
|
|
game.load.image('bonus_meat_burn', '../../../resources/image/object/grilled_meat/meat_bonus_burn.png');
|
|
|
|
game.load.image('smoke', '../../../resources/image/ui/smoke.png');
|
|
|
|
game.load.image('speech_bubble_angry', '../../../resources/image/ui/speech_bubble_angry.png');
|
|
game.load.image('speech_bubble_happy', '../../../resources/image/ui/speech_bubble_happy.png');
|
|
|
|
game.load.image('speech_double_star_bg', '../../../resources/image/object/speech_bubble/speech_double_star_bg.png');
|
|
game.load.image('speech_double_star_shadow', '../../../resources/image/object/speech_bubble/speech_double_star_shadow.png');
|
|
game.load.image('speech_double_star_outline', '../../../resources/image/object/speech_bubble/speech_double_star_outline.png');
|
|
|
|
game.load.image('speech_star_bg', '../../../resources/image/object/speech_bubble/speech_star_bg.png');
|
|
game.load.image('speech_star_shadow', '../../../resources/image/object/speech_bubble/speech_star_shadow.png');
|
|
game.load.image('speech_star_outline', '../../../resources/image/object/speech_bubble/speech_star_outline.png');
|
|
|
|
game.load.image('speech_round_bg', '../../../resources/image/object/speech_bubble/speech_round_bg.png');
|
|
game.load.image('speech_round_shadow', '../../../resources/image/object/speech_bubble/speech_round_shadow.png');
|
|
game.load.image('speech_round_outline', '../../../resources/image/object/speech_bubble/speech_round_outline.png');
|
|
|
|
game.load.image('speech_rect_bg', '../../../resources/image/object/speech_bubble/speech_rect_bg.png');
|
|
game.load.image('speech_rect_shadow', '../../../resources/image/object/speech_bubble/speech_rect_shadow.png');
|
|
game.load.image('speech_rect_outline', '../../../resources/image/object/speech_bubble/speech_rect_outline.png');
|
|
|
|
game.load.image('heart_full', '../../../resources/image/ui/heart_full.png');
|
|
game.load.image('heart_empty', '../../../resources/image/ui/heart_empty.png');
|
|
|
|
game.load.image('god_angry', '../../../resources/image/character/god/god_hungry.png');
|
|
game.load.image('god_smile', '../../../resources/image/character/god/god_smile.png');
|
|
game.load.image('god_happy', '../../../resources/image/character/god/god_happy.png');
|
|
|
|
game.load.image('waiter', '../../../resources/image/character/child/child.png');
|
|
|
|
// game.load.image('a', '../../../resources/image/icon/fullscreen_white.png');
|
|
// game.load.image('b', '../../../resources/image/icon/fullscreen_white.png');
|
|
// game.load.image('c', '../../../resources/image/icon/fullscreen_white.png');
|
|
// game.load.image('d', '../../../resources/image/icon/fullscreen_white.png');
|
|
// game.load.image('a', './image/phaser.png');
|
|
// game.load.image('b', './image/phaser.png');
|
|
// game.load.image('c', './image/phaser.png');
|
|
// game.load.image('d', './image/phaser.png');
|
|
// game.load.image('e', './image/phaser.png');
|
|
// game.load.image('g', './image/phaser.png');
|
|
// game.load.image('e', './image/phaser.png');
|
|
// game.load.image('f', './image/phaser.png');
|
|
// game.load.image('g', './image/phaser.png');
|
|
// game.load.image('h', './image/phaser.png');
|
|
|
|
// game.load.image('phaser', './image/phaser.png');
|
|
// game.load.spritesheet('button', './image/button_basic.png', 200, 100);
|
|
// game.load.image('star', './image/star_particle.png');
|
|
// game.load.image('medal_gold', './image/medal_gold.png');
|
|
// game.load.image('medal_silver', './image/medal_silver.png');
|
|
// game.load.image('medal_bronze', './image/medal_bronze.png');
|
|
|
|
game.load.start();
|
|
},
|
|
|
|
fileComplete: function(progress, cacheKey, success, totalLoaded, totalFiles) {
|
|
// this.preloadBar.alpha = progress / 100;
|
|
|
|
// console.log('progress : ' + progress);
|
|
|
|
// text.setText("File Complete: " + progress + "% - " + totalLoaded + " out of " + totalFiles);
|
|
|
|
// var newImage = game.add.image(x, y, cacheKey);
|
|
// newImage.scale.set(0.3);
|
|
|
|
// x += newImage.width + 20;
|
|
// if (x > 700)
|
|
// {
|
|
// x = 32;
|
|
// y += 332;
|
|
// }
|
|
},
|
|
|
|
loadComplete: function(progress, cacheKey, success, totalLoaded, totalFiles) {
|
|
// this.preloadBar.alpha = 1;
|
|
|
|
if(isDebugMode()) {
|
|
this.state.start('Game');
|
|
return;
|
|
}
|
|
|
|
this.state.start('Game');
|
|
// this.startMenu();
|
|
// this.startTypingTestStage();
|
|
// this.startTypingTestResult();
|
|
}
|
|
}
|