diff --git a/resources/file/typing_exam/system/english_good_night.txt b/resources/file/typing_exam/system/english_good_night.txt new file mode 100644 index 0000000..5361fe9 --- /dev/null +++ b/resources/file/typing_exam/system/english_good_night.txt @@ -0,0 +1,6 @@ +Good night + +Good night Daddy +Good night Mom +Good night Robby +It's time to go to bed \ No newline at end of file diff --git a/resources/file/typing_exam/system/english_hey_diddle.txt b/resources/file/typing_exam/system/english_hey_diddle.txt new file mode 100644 index 0000000..17ead6e --- /dev/null +++ b/resources/file/typing_exam/system/english_hey_diddle.txt @@ -0,0 +1,7 @@ +Hey diddle diddle + +Hey diddle diddle +The cat and the fiddle, +The cow jumped over the moon. +The little dog laughed to see such sport, +And the dish ran away with the spoon. \ No newline at end of file diff --git a/resources/file/typing_exam/system/english_twinkle_little_star.txt b/resources/file/typing_exam/system/english_twinkle_little_star.txt new file mode 100644 index 0000000..2cd17b3 --- /dev/null +++ b/resources/file/typing_exam/system/english_twinkle_little_star.txt @@ -0,0 +1,11 @@ +Twinkle twinkle little star +Jane Taylor + +Twinkle twinkle little star +how I wonder what you are + +Up above the world so high +like a diamond in the sky + +Twinkle twinkle little star +how I wonder what you are \ No newline at end of file diff --git a/resources/file/typing_exam/system/korean_calf.txt b/resources/file/typing_exam/system/korean_calf.txt new file mode 100644 index 0000000..7aaf14c --- /dev/null +++ b/resources/file/typing_exam/system/korean_calf.txt @@ -0,0 +1,14 @@ +송아지 +박목월 + +송아지 송아지 +얼룩 송아지 + +엄마소도 얼룩소 +엄마 닮았네 + +송아지 송아지 +얼룩 송아지 + +두 귀가 얼룩귀 +귀가 닮았네 \ No newline at end of file diff --git a/resources/file/typing_exam/system/korean_halfmoon.txt b/resources/file/typing_exam/system/korean_halfmoon.txt new file mode 100644 index 0000000..f657274 --- /dev/null +++ b/resources/file/typing_exam/system/korean_halfmoon.txt @@ -0,0 +1,22 @@ +반달 +윤극영 + +푸른 하늘 은하수 +하얀 쪽배엔 +계수나무 한나무 +토끼 한마리 + +돛대도 아니달고 +삿대도 없이 +가기도 잘도 간다 +서쪽 나라로 + +은하수를 건너서 +구름 나라로 +구름 나라 지나선 +어디로 가나 + +멀리서 반짝반짝 +비치이는건 +샛별이 등대란다 +길을 찾아라 \ No newline at end of file diff --git a/resources/file/typing_exam/system/korean_mr_elephant.txt b/resources/file/typing_exam/system/korean_mr_elephant.txt new file mode 100644 index 0000000..524d1b7 --- /dev/null +++ b/resources/file/typing_exam/system/korean_mr_elephant.txt @@ -0,0 +1,12 @@ +코끼리 아저씨 +강소천 + +코끼리 아저씨는 +코가 손이래 +과자를 주면은 +코로 받지요 + +코끼리 아저씨는 +소방수래요 +불나면 빨리와 +모셔 가지요 \ No newline at end of file diff --git a/resources/file/typing_exam/system/korean_santoki.txt b/resources/file/typing_exam/system/korean_santoki.txt new file mode 100644 index 0000000..e10cf8a --- /dev/null +++ b/resources/file/typing_exam/system/korean_santoki.txt @@ -0,0 +1,12 @@ +산토끼 +이일래 + +산토끼 토끼야 +어디를 가느냐 +깡충 깡충 뛰면서 +어디를 가느냐 + +산고개 고개를 +나 혼자 넘어서 +토실 토실 알밤을 +주워서 올테야 \ No newline at end of file diff --git a/resources/image/object/grilled_meat/heat_plate_flame.png b/resources/image/object/grilled_meat/heat_plate_flame.png new file mode 100644 index 0000000..de4240a Binary files /dev/null and b/resources/image/object/grilled_meat/heat_plate_flame.png differ diff --git a/resources/image/object/grilled_meat/stove.afdesign b/resources/image/object/grilled_meat/stove.afdesign new file mode 100644 index 0000000..61bc1e2 Binary files /dev/null and b/resources/image/object/grilled_meat/stove.afdesign differ diff --git a/resources/image/object/grilled_meat/stove_dial.png b/resources/image/object/grilled_meat/stove_dial.png new file mode 100644 index 0000000..fa1b7e7 Binary files /dev/null and b/resources/image/object/grilled_meat/stove_dial.png differ diff --git a/resources/image/object/grilled_meat/stove_dial_dot.png b/resources/image/object/grilled_meat/stove_dial_dot.png new file mode 100644 index 0000000..4eef00e Binary files /dev/null and b/resources/image/object/grilled_meat/stove_dial_dot.png differ diff --git a/src/game/mouse/grilled_meat/game.js b/src/game/mouse/grilled_meat/game.js index 44fdf92..80ea9dc 100644 --- a/src/game/mouse/grilled_meat/game.js +++ b/src/game/mouse/grilled_meat/game.js @@ -62,10 +62,16 @@ var Game = { this.meatPlate.anchor.set(0.5); this.meatPlate.smoothed = false; - this.heatPlate = game.add.image(game.world.centerX, Game.HEAT_PLATE_POSITION_Y, 'heat_plate'); - this.heatPlate.anchor.set(0.5); - this.heatPlate.smoothed = false; - this.heatPlate.scale.set(1); + // this.heatPlate = game.add.image(game.world.centerX, Game.HEAT_PLATE_POSITION_Y, 'heat_plate'); + // this.heatPlate.anchor.set(0.5); + // this.heatPlate.smoothed = false; + // this.heatPlate.scale.set(1); + + this.heatPlate = new HeatPlate(game.world.centerX, Game.HEAT_PLATE_POSITION_Y); + this.stoveDial = new StoveDial(80, Game.HEAT_PLATE_POSITION_Y + 50); + this.stoveDial.setOnChangeDialLevelHandler( + (function(dialLevel) { this.onChangeDialLevel(dialLevel); }).bind(this) + ); this.god = new God(game.world.width - 120, Game.GOD_POSITION_Y + 100, this); @@ -112,9 +118,15 @@ var Game = { this.meatCount; this.badMeatCount = 0; + + this.burnLevel = HeatPlate.BURN_LEVEL_WEAK; }, + onChangeDialLevel: function(dialLevel) { + this.burnLevel = dialLevel; + this.heatPlate.onChangeDialLevel(dialLevel); + }, back: function() { sessionStorageManager.resetPlayingAppData(); diff --git a/src/game/mouse/grilled_meat/god.js b/src/game/mouse/grilled_meat/god.js index 41fe21a..11d0b67 100644 --- a/src/game/mouse/grilled_meat/god.js +++ b/src/game/mouse/grilled_meat/god.js @@ -1,4 +1,7 @@ -God = function(x, y, mainGame) { +God.prototype = Object.create(Phaser.Sprite.prototype); +God.prototype.constructor = God; + +function God(x, y, mainGame) { this.mainGame = mainGame; this.isActivated = true; @@ -11,10 +14,44 @@ God = function(x, y, mainGame) { // this.events.onInputDown.add(this.onDown, this); game.add.existing(this); + + game.physics.startSystem(Phaser.Physics.ARCADE); + + this.fullHeartEmitter = game.add.emitter(x, y - 150, 20); + this.fullHeartEmitter.makeParticles("heart_full"); + this.fullHeartEmitter.minParticleScale = 0.5; + this.fullHeartEmitter.maxParticleScale = 0.7; + this.fullHeartEmitter.minParticleSpeed.setTo(-150, -700); + this.fullHeartEmitter.maxParticleSpeed.setTo(150, -500); + this.fullHeartEmitter.gravity = 1500; + + this.emptyHeartEmitter = game.add.emitter(x, y - 150, 20); + this.emptyHeartEmitter.makeParticles("heart_empty"); + this.emptyHeartEmitter.minParticleScale = 0.5; + this.emptyHeartEmitter.maxParticleScale = 0.7; + this.emptyHeartEmitter.minParticleSpeed.setTo(-150, -700); + this.emptyHeartEmitter.maxParticleSpeed.setTo(150, -500); + this.emptyHeartEmitter.gravity = 1500; + + this.angryEmitter = game.add.emitter(x, y - 200, 20); + this.angryEmitter.makeParticles("smoke"); + this.angryEmitter.width = 30; + this.angryEmitter.height = 30; + this.angryEmitter.setRotation(-90, 90); + this.angryEmitter.setAlpha(0.1, 0.3); + // this.angryEmitter.setScale(0.2, 0.2); + this.angryEmitter.minParticleScale = 0.5; + this.angryEmitter.maxParticleScale = 1; + this.angryEmitter.gravity = -300; + + this.angryEmitter.forEach( + function(particle) { + particle.tint = 0xf0f0f0; + } + ); } -God.prototype = Object.create(Phaser.Sprite.prototype); -God.prototype.constructor = God; + God.prototype.update = function() { } @@ -48,6 +85,8 @@ God.prototype.animateHappy = function(type) { // tween.to({x:0.7, y:0.7}, 1000, Phaser.Easing.Linear.None, true, 0); tween.onComplete.add(this.smileAgain, this); tween.start(); + + this.particleBurst(God.REACTION_HAPPY); } God.prototype.animateAngry = function(type) { @@ -60,9 +99,39 @@ God.prototype.animateAngry = function(type) { // tween.to({x:0.7, y:0.7}, 1000, Phaser.Easing.Linear.None, true, 0); tween.onComplete.add(this.smileAgain, this); tween.start(); + + this.particleBurst(God.REACTION_ANGRY); } God.prototype.smileAgain = function() { this.scale.set(0.5); this.loadTexture('god_smile'); -} \ No newline at end of file +} + + +God.prototype.particleBurst = function(reaction) { + // if(this.fullHeartEmitter.on) + // this.fullHeartEmitter.on = false; + + // if(this.emptyHeartEmitter.on) + // this.emptyHeartEmitter.on = false; + + switch(reaction) { + case God.REACTION_HAPPY: + this.fullHeartEmitter.start(true, 900, 100, 15, true); + break; + + case God.REACTION_SMILE: + this.emptyHeartEmitter.start(true, 900, 100, 15, true); + break; + + case God.REACTION_ANGRY: + this.angryEmitter.start(true, 900, 100, 15, true); + break; + } +} + + +God.REACTION_HAPPY = 0; +God.REACTION_SMILE = 1; +God.REACTION_ANGRY = 2; \ No newline at end of file diff --git a/src/game/mouse/grilled_meat/heat_plate.js b/src/game/mouse/grilled_meat/heat_plate.js new file mode 100644 index 0000000..b9f41f6 --- /dev/null +++ b/src/game/mouse/grilled_meat/heat_plate.js @@ -0,0 +1,56 @@ +HeatPlate.prototype = Object.create(Phaser.Sprite.prototype); +HeatPlate.prototype.constructor = HeatPlate; + +function HeatPlate(x, y) { + Phaser.Sprite.call(this, game, x, y, 'heat_plate'); + this.anchor.set(0.5); + // this.scale.set(0.5); + this.smoothed = false; + this.inputEnabled = false; + game.add.existing(this); + + // add 3 sprites for flame + // this.spriteFlame = game.make.sprite(0, 0, "flame_weak"); + this.spriteFlame = game.make.sprite(0, 0, "heat_plate_flame"); + this.spriteFlame.anchor.set(0.5, 0.65); + // this.spriteFlame.scale.set(0.5); + this.spriteFlame.smoothed = false; + this.spriteFlame.alpha = 0.3; + + this.addChild(this.spriteFlame); + this.setBurnLevel(HeatPlate.BURN_LEVEL_WEAK); + game.add.tween(this.spriteFlame).to( { alpha: 0.8 }, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true); +} + + +HeatPlate.prototype.setBurnLevel = function(burlLevel) { + this.burnLevel = burlLevel; + + switch(this.burnLevel) { + case HeatPlate.BURN_LEVEL_WEAK: + this.spriteFlame.tint = HeatPlate.BURN_COLOR_WEAK; + break; + + case HeatPlate.BURN_LEVEL_NORMAL: + this.spriteFlame.tint = HeatPlate.BURN_COLOR_NORMAL; + break; + + case HeatPlate.BURN_LEVEL_STRONG: + this.spriteFlame.tint = HeatPlate.BURN_COLOR_STRONG; + break; + } +} + +HeatPlate.prototype.onChangeDialLevel = function(dialLevel) { + this.setBurnLevel(dialLevel); +} + + + +HeatPlate.BURN_LEVEL_WEAK = 0; +HeatPlate.BURN_LEVEL_NORMAL = 1; +HeatPlate.BURN_LEVEL_STRONG = 2; + +HeatPlate.BURN_COLOR_WEAK = 0xfd9466; +HeatPlate.BURN_COLOR_NORMAL = 0xbd5915; +HeatPlate.BURN_COLOR_STRONG = 0xcd0030; \ No newline at end of file diff --git a/src/game/mouse/grilled_meat/loading.js b/src/game/mouse/grilled_meat/loading.js index d054224..3b62304 100644 --- a/src/game/mouse/grilled_meat/loading.js +++ b/src/game/mouse/grilled_meat/loading.js @@ -30,9 +30,15 @@ var Loading = { 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('heat_plate', '../../../resources/image/object/grilled_meat/heat_plate.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('meat1', '../../../resources/image/object/grilled_meat/meat1.png'); game.load.image('meat2', '../../../resources/image/object/grilled_meat/meat2.png'); game.load.image('meat3', '../../../resources/image/object/grilled_meat/meat3.png'); @@ -51,6 +57,9 @@ var Loading = { 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('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'); diff --git a/src/game/mouse/grilled_meat/stove_dial.js b/src/game/mouse/grilled_meat/stove_dial.js new file mode 100644 index 0000000..1dae4d1 --- /dev/null +++ b/src/game/mouse/grilled_meat/stove_dial.js @@ -0,0 +1,77 @@ +StoveDial.prototype = Object.create(Phaser.Sprite.prototype); +StoveDial.prototype.constructor = StoveDial; + +function StoveDial(x, y) { + Phaser.Sprite.call(this, game, x, y, 'stove_dial'); + this.anchor.set(0.5); + // this.scale.set(0.5); + this.smoothed = false; + this.inputEnabled = true; + game.add.existing(this); + + this.events.onInputDown.add( + (function() { this.onDown(); }).bind(this), + this + ); + + this.addDotSprite(); + + this.state = HeatPlate.BURN_LEVEL_WEAK; + this.setDialLevel(); +} + + +StoveDial.prototype.addDotSprite = function() { + this.dot = game.make.sprite(0, -27, "stove_dial_dot"); + this.dot.anchor.set(0.5); + this.dot.smoothed = false; + this.dot.tint = 0xff0000; + this.addChild(this.dot); +} + +StoveDial.prototype.onDown = function() { + switch(this.state) { + case HeatPlate.BURN_LEVEL_WEAK: + this.state = HeatPlate.BURN_LEVEL_NORMAL; + break; + + case HeatPlate.BURN_LEVEL_NORMAL: + this.state = HeatPlate.BURN_LEVEL_STRONG; + break; + + case HeatPlate.BURN_LEVEL_STRONG: + this.state = HeatPlate.BURN_LEVEL_WEAK; + break; + } + + this.setDialLevel(); + this.onChangeDialLevel(this.state); +} + +StoveDial.prototype.setOnChangeDialLevelHandler = function(eventHandler) { + this.onChangeDialLevel = eventHandler; +} + + +StoveDial.prototype.setDialLevel = function() { + switch(this.state) { + case HeatPlate.BURN_LEVEL_WEAK: + this.angle = 30; + this.dot.tint = StoveDial.BURN_COLOR_WEAK; + break; + + case HeatPlate.BURN_LEVEL_NORMAL: + this.angle = 60; + this.dot.tint = StoveDial.BURN_COLOR_NORMAL; + break; + + case HeatPlate.BURN_LEVEL_STRONG: + this.angle = 90; + this.dot.tint = StoveDial.BURN_COLOR_STRONG; + break; + } +} + +StoveDial.BURN_COLOR_WEAK = 0xf7d708; +StoveDial.BURN_COLOR_NORMAL = 0xbd5915; +StoveDial.BURN_COLOR_STRONG = 0xcd0030; \ No newline at end of file diff --git a/src/web/client/grilled_meat.html b/src/web/client/grilled_meat.html index e95fd1b..1c89ee6 100644 --- a/src/web/client/grilled_meat.html +++ b/src/web/client/grilled_meat.html @@ -69,6 +69,8 @@ + +