Fix: spaceship image, start random flyingsaucer
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 528 B After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 264 B After Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 585 B After Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
@@ -1,15 +1,14 @@
|
|||||||
CenterMessageText.prototype = Object.create(Phaser.Text.prototype);
|
CenterMessageText.prototype = Object.create(Phaser.Text.prototype);
|
||||||
CenterMessageText.constructor = CenterMessageText;
|
CenterMessageText.constructor = CenterMessageText;
|
||||||
|
|
||||||
function CenterMessageText(contentText) {
|
function CenterMessageText() {
|
||||||
Phaser.Text.call(
|
Phaser.Text.call(
|
||||||
this, game,
|
this, game,
|
||||||
game.world.width / 2,
|
game.world.width / 2,
|
||||||
game.world.height / 2 - CenterMessageText.MOVE_AMOUNT_PX,
|
game.world.height / 2 - CenterMessageText.MOVE_AMOUNT_PX,
|
||||||
contentText,
|
"",
|
||||||
CenterMessageText.DEFAULT_TEXT_FONT
|
CenterMessageText.DEFAULT_TEXT_FONT
|
||||||
);
|
);
|
||||||
// super(game, 600, 300, "게임 오버", CenterMessageText.DEFAULT_TEXT_FONT);
|
|
||||||
|
|
||||||
this.anchor.set(0.5);
|
this.anchor.set(0.5);
|
||||||
this.inputEnabled = false;
|
this.inputEnabled = false;
|
||||||
@@ -18,37 +17,55 @@ function CenterMessageText(contentText) {
|
|||||||
// grd.addColorStop(0, CenterMessageText.COLOR_GRADATION_START); //'#FFD68E');
|
// grd.addColorStop(0, CenterMessageText.COLOR_GRADATION_START); //'#FFD68E');
|
||||||
// grd.addColorStop(1, CenterMessageText.COLOR_GRADATION_END); //'#B34C00');
|
// grd.addColorStop(1, CenterMessageText.COLOR_GRADATION_END); //'#B34C00');
|
||||||
// this.fill = grd;
|
// this.fill = grd;
|
||||||
this.fill = CenterMessageText.COLOR_TEXT;
|
// this.fill = CenterMessageText.COLOR_TEXT;
|
||||||
// this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
// this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||||
this.stroke = CenterMessageText.COLOR_STROKE;
|
this.stroke = CenterMessageText.COLOR_STROKE;
|
||||||
this.strokeThickness = 9;
|
this.strokeThickness = 9;
|
||||||
|
|
||||||
|
this.tweenAlpha = game.add.tween(this);
|
||||||
|
this.tweenAlpha.to( { alpha: 0 }, CenterMessageText.TWEEN_ALPHA_TIME, Phaser.Easing.Elastic.In, false);
|
||||||
|
// this.tweenAlpha.onComplete.addOnce(this.hide, this);
|
||||||
|
|
||||||
this.alpha = 1;
|
this.timerEventTween = null;
|
||||||
var tweenAlpha = game.add.tween(this);
|
|
||||||
tweenAlpha.to( { alpha: 0 }, CenterMessageText.TWEEN_ALPHA_TIME, Phaser.Easing.Elastic.In, true);
|
|
||||||
tweenAlpha.onComplete.addOnce(this.destroy, this);
|
|
||||||
|
|
||||||
// var tweenScale = game.add.tween(this.scale);
|
|
||||||
// tweenScale.to( { x: 0.8, y: 0.8 }, CenterMessageText.TWEEN_SCALE_TIME, Phaser.Easing.Bounce.Out, true);
|
|
||||||
// tweenScale.onComplete.addOnce(this.destroy, this);
|
|
||||||
|
|
||||||
|
this.alpha = 0;
|
||||||
game.add.existing(this);
|
game.add.existing(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CenterMessageText.prototype.showText = function(wordLevel, wordLevelText) {
|
||||||
|
if(this.timerEventTween)
|
||||||
|
game.time.events.remove(this.timerEventTween);
|
||||||
|
|
||||||
|
if(this.tweenAlpha != null)
|
||||||
|
this.tweenAlpha.stop();
|
||||||
|
|
||||||
|
this.text = "[ " + wordLevelText + " ] 단계 활성화";
|
||||||
|
this.fill = GameLevelManager.CENTER_MESSAGE_TEXT_COLOR_LIST[wordLevel];
|
||||||
|
this.stroke = GameLevelManager.CENTER_MESSAGE_STROKE_COLOR_LIST[wordLevel];
|
||||||
|
// console.log(this.fill);
|
||||||
|
// console.log(this.stroke);
|
||||||
|
|
||||||
|
this.alpha = 1;
|
||||||
|
this.tweenAlpha.start();
|
||||||
|
|
||||||
|
this.timerEventTween = game.time.events.add(CenterMessageText.TWEEN_ALPHA_TIME, this.hide, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
CenterMessageText.prototype.hide = function() {
|
||||||
|
this.alpha = 0;
|
||||||
|
}
|
||||||
|
|
||||||
CenterMessageText.DEFAULT_TEXT_FONT = {
|
CenterMessageText.DEFAULT_TEXT_FONT = {
|
||||||
font: "bold 40px Arial", // "bold 100px Arial",
|
font: "bold 40px Arial",
|
||||||
boundsAlignH: "center", // left, center. right
|
boundsAlignH: "center", // left, center. right
|
||||||
boundsAlignV: "middle", // top, middle, bottom
|
boundsAlignV: "middle", // top, middle, bottom
|
||||||
fill: CenterMessageText.COLOR_TEXT // "#fff"
|
fill: "#ffffff"
|
||||||
};
|
};
|
||||||
|
|
||||||
CenterMessageText.MOVE_AMOUNT_PX = 100;
|
CenterMessageText.MOVE_AMOUNT_PX = 100;
|
||||||
CenterMessageText.TWEEN_ALPHA_TIME = 1500;
|
CenterMessageText.TWEEN_ALPHA_TIME = 1500;
|
||||||
CenterMessageText.TWEEN_SCALE_TIME = 1500;
|
|
||||||
|
|
||||||
CenterMessageText.COLOR_TEXT = "#ffcc00"; // "#cc9900";
|
CenterMessageText.COLOR_TEXT = "#ffcc00";
|
||||||
CenterMessageText.COLOR_GRADATION_START = "#B34C00"; // "#333333"; //"#666666";
|
CenterMessageText.COLOR_GRADATION_START = "#B34C00";
|
||||||
CenterMessageText.COLOR_GRADATION_END = "#333333"; // "#B34C00";
|
CenterMessageText.COLOR_GRADATION_END = "#333333";
|
||||||
CenterMessageText.COLOR_STROKE = "#663300"; //"#FFDD88"; //"#FFD68E";
|
CenterMessageText.COLOR_STROKE = "#663300";
|
||||||
@@ -57,6 +57,17 @@ ExtractWordManager.prototype.initVariables = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ExtractWordManager.prototype.getWordLevelCount = function() {
|
||||||
|
// console.log("this.easyWordList.length : " + this.easyWordList.length);
|
||||||
|
// console.log("this.hardWordList.length : " + this.hardWordList.length);
|
||||||
|
|
||||||
|
var wordLevelCount = this.easyWordList.length;
|
||||||
|
if(wordLevelCount < this.hardWordList.length)
|
||||||
|
wordLevelCount = this.hardWordList.length;
|
||||||
|
|
||||||
|
return wordLevelCount;
|
||||||
|
}
|
||||||
|
|
||||||
ExtractWordManager.prototype.pickOutDifficulty = function(wordList, difficultyForLevel) {
|
ExtractWordManager.prototype.pickOutDifficulty = function(wordList, difficultyForLevel) {
|
||||||
var pickOutWordList = [];
|
var pickOutWordList = [];
|
||||||
|
|
||||||
@@ -120,6 +131,12 @@ ExtractWordManager.prototype.getWord = function(wordLevel, difficultyForLevel) {
|
|||||||
// console.log("wordLevel : " + wordLevel);
|
// console.log("wordLevel : " + wordLevel);
|
||||||
// console.log("difficultyForLevel : " + difficultyForLevel);
|
// console.log("difficultyForLevel : " + difficultyForLevel);
|
||||||
|
|
||||||
|
if(this.easyWordList[wordLevel] == undefined || this.hardWordList[wordLevel] == undefined) {
|
||||||
|
console.log("====== Error ======");
|
||||||
|
console.log("wordLevel : " + wordLevel);
|
||||||
|
console.log("difficultyForLevel : " + difficultyForLevel);
|
||||||
|
}
|
||||||
|
|
||||||
var word = "";
|
var word = "";
|
||||||
if(difficultyForLevel == ExtractWordManager.DIFFICULTY_EASY)
|
if(difficultyForLevel == ExtractWordManager.DIFFICULTY_EASY)
|
||||||
word = this.spliceRandomWord(this.easyWordList[wordLevel]);
|
word = this.spliceRandomWord(this.easyWordList[wordLevel]);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ function FlyingSaucer(lineIndex) {
|
|||||||
this.initVariables();
|
this.initVariables();
|
||||||
|
|
||||||
|
|
||||||
Phaser.Sprite.call(this, game, game.world.centerX, game.world.centerY, 'alien_normal');
|
Phaser.Sprite.call(this, game, game.world.centerX, game.world.centerY, 'ship_cockpit');
|
||||||
game.add.existing(this);
|
game.add.existing(this);
|
||||||
game.physics.arcade.enable(this);
|
game.physics.arcade.enable(this);
|
||||||
|
|
||||||
@@ -15,11 +15,11 @@ function FlyingSaucer(lineIndex) {
|
|||||||
this.anchor.set(0.5);
|
this.anchor.set(0.5);
|
||||||
this.halfWidth = this.width / 2;
|
this.halfWidth = this.width / 2;
|
||||||
|
|
||||||
var COCKPIT_OFFSET_Y = -5;
|
var ALIEN_OFFSET_Y = -12;
|
||||||
var BODY_OFFSET_Y = 28;
|
var BODY_OFFSET_Y = 14;
|
||||||
var JET_OFFSET_Y = 52;
|
var JET_OFFSET_Y = 40;
|
||||||
|
|
||||||
this.cockpit = this.makeCockpit(0, COCKPIT_OFFSET_Y);
|
this.cockpit = this.makeAlien(0, ALIEN_OFFSET_Y);
|
||||||
this.addChild(this.cockpit);
|
this.addChild(this.cockpit);
|
||||||
|
|
||||||
this.jetLeft = this.makeJet(-50, JET_OFFSET_Y);
|
this.jetLeft = this.makeJet(-50, JET_OFFSET_Y);
|
||||||
@@ -69,19 +69,17 @@ FlyingSaucer.prototype.initVariables = function() {
|
|||||||
this.tweenScale = null;
|
this.tweenScale = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
FlyingSaucer.prototype.makeCockpit = function(posX, posY) {
|
FlyingSaucer.prototype.makeAlien = function(posX, posY) {
|
||||||
var cockpit = game.make.sprite(posX, posY, 'ship_cockpit');
|
var alien = game.make.sprite(posX, posY, 'alien_normal');
|
||||||
cockpit.anchor.set(0.5);
|
alien.anchor.set(0.5);
|
||||||
cockpit.alpha = 0.6;
|
|
||||||
cockpit.tint = 0xff00ff;
|
|
||||||
|
|
||||||
return cockpit;
|
return alien;
|
||||||
}
|
}
|
||||||
|
|
||||||
FlyingSaucer.prototype.makeJet = function(posX, posY) {
|
FlyingSaucer.prototype.makeJet = function(posX, posY) {
|
||||||
var jet = game.make.sprite(posX, posY, 'ship_jet');
|
var jet = game.make.sprite(posX, posY, 'ship_jet');
|
||||||
jet.anchor.set(0.5);
|
jet.anchor.set(0.5);
|
||||||
jet.tint = FlyingSaucer.JET_COLOR_HIGH;
|
// jet.tint = FlyingSaucer.JET_COLOR_HIGH;
|
||||||
|
|
||||||
return jet;
|
return jet;
|
||||||
}
|
}
|
||||||
@@ -142,7 +140,7 @@ FlyingSaucer.prototype.changeJetColor = function(color) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FlyingSaucer.prototype.changeCockpitColor = function(color) {
|
FlyingSaucer.prototype.changeCockpitColor = function(color) {
|
||||||
this.cockpit.tint = FlyingSaucer.COKCPIT_COLOR[this.wordLevel];
|
this.tint = GameLevelManager.COCKPIT_COLOR_LIST[this.wordLevel];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -218,7 +216,7 @@ FlyingSaucer.prototype.startAttack = function() {
|
|||||||
this.word = this.extractWordManager.getWord(this.wordLevel, this.difficultyForLevel);
|
this.word = this.extractWordManager.getWord(this.wordLevel, this.difficultyForLevel);
|
||||||
// console.log("this.word : " + this.word);
|
// console.log("this.word : " + this.word);
|
||||||
this.setWord(this.word);
|
this.setWord(this.word);
|
||||||
this.standardScore = this.gameLevelManager.getStandardScore(this.wordLevel, this.speed);
|
this.standardScore = this.gameLevelManager.getStandardScore(this.wordLevel, this.difficultyForLevel, this.speed);
|
||||||
// console.log(this.standardScore);
|
// console.log(this.standardScore);
|
||||||
|
|
||||||
this.moveInitialPos();
|
this.moveInitialPos();
|
||||||
@@ -365,10 +363,10 @@ FlyingSaucer.SPEED_DOWN_AMOUNT = FlyingSaucer.SPEED_UP_AMOUNT / 2; // dot per s
|
|||||||
FlyingSaucer.START_POS_Y = 100; // px
|
FlyingSaucer.START_POS_Y = 100; // px
|
||||||
FlyingSaucer.CRASH_POS_Y = GAME_SCREEN_SIZE.y - 200; // px
|
FlyingSaucer.CRASH_POS_Y = GAME_SCREEN_SIZE.y - 200; // px
|
||||||
|
|
||||||
FlyingSaucer.WORD_TEXT_OFFSET_Y = 30; // px
|
FlyingSaucer.WORD_TEXT_OFFSET_Y = 18; // px
|
||||||
|
|
||||||
FlyingSaucer.TEXT_COLOR_NORMAL = "#000000";
|
FlyingSaucer.TEXT_COLOR_NORMAL = "#ffffff";
|
||||||
FlyingSaucer.TEXT_COLOR_CORRECT = "#ffff4d";
|
FlyingSaucer.TEXT_COLOR_CORRECT = "#ffcc00"; // "#ffff4d";
|
||||||
FlyingSaucer.TEXT_STROKE_COLOR = "#ffffff";
|
FlyingSaucer.TEXT_STROKE_COLOR = "#ffffff";
|
||||||
|
|
||||||
FlyingSaucer.JET_STATUS_HIGH = 0;
|
FlyingSaucer.JET_STATUS_HIGH = 0;
|
||||||
@@ -377,10 +375,4 @@ FlyingSaucer.JET_STATUS_LOW = 2;
|
|||||||
|
|
||||||
FlyingSaucer.JET_COLOR_HIGH = 0x00ff00; //0x00ffff;
|
FlyingSaucer.JET_COLOR_HIGH = 0x00ff00; //0x00ffff;
|
||||||
FlyingSaucer.JET_COLOR_MIDDLE = 0xffff00; //0xffff00;
|
FlyingSaucer.JET_COLOR_MIDDLE = 0xffff00; //0xffff00;
|
||||||
FlyingSaucer.JET_COLOR_LOW = 0xff0000;
|
FlyingSaucer.JET_COLOR_LOW = 0xff0000;
|
||||||
|
|
||||||
FlyingSaucer.COKCPIT_COLOR = [
|
|
||||||
// 0xff0000, 0xff6600, 0xffff00, 0x00ffff, 0x00ffff, 0x6666ff, 0xff00ff
|
|
||||||
// 0x00ffff, 0x55aacc, 0x0000ff, 0x8800cc, 0xff00ff, 0x6666ff, 0xff00ff
|
|
||||||
0xffff33, 0x00ff00, 0x00ccff, 0x3366ff, 0x9933ff, 0xff00ff, 0xff6600
|
|
||||||
]
|
|
||||||
@@ -55,10 +55,10 @@ var WordFlyingSaucer = {
|
|||||||
this.flyingsaucers[i].setHeartManager(this.heartManager);
|
this.flyingsaucers[i].setHeartManager(this.heartManager);
|
||||||
this.flyingsaucers[i].setExtractWordManager(this.extractWordManager);
|
this.flyingsaucers[i].setExtractWordManager(this.extractWordManager);
|
||||||
this.flyingsaucers[i].setGameLevelManager(this.gameLevelManager);
|
this.flyingsaucers[i].setGameLevelManager(this.gameLevelManager);
|
||||||
this.flyingsaucers[i].startAttack();
|
// this.flyingsaucers[i].startAttack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.centerMessageText = new CenterMessageText();
|
||||||
|
|
||||||
// top ui
|
// top ui
|
||||||
var screenTopUI = new ScreenTopUI();
|
var screenTopUI = new ScreenTopUI();
|
||||||
@@ -93,8 +93,7 @@ var WordFlyingSaucer = {
|
|||||||
this.screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
|
this.screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
|
||||||
|
|
||||||
|
|
||||||
// this.startGame();
|
this.startGame();
|
||||||
this.showLevelUpText();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
@@ -107,6 +106,7 @@ var WordFlyingSaucer = {
|
|||||||
initVariables: function() {
|
initVariables: function() {
|
||||||
this.extractWordManager = new ExtractWordManager();
|
this.extractWordManager = new ExtractWordManager();
|
||||||
this.gameLevelManager = new GameLevelManager(this);
|
this.gameLevelManager = new GameLevelManager(this);
|
||||||
|
this.gameLevelManager.setExtractWordManager(this.extractWordManager);
|
||||||
|
|
||||||
this.speedLevel = 0;
|
this.speedLevel = 0;
|
||||||
|
|
||||||
@@ -144,7 +144,6 @@ var WordFlyingSaucer = {
|
|||||||
bmd.rect(0, y, GAME_SCREEN_SIZE.x, y + GRADIATION_HEIGHT, Phaser.Color.getWebRGB(c));
|
bmd.rect(0, y, GAME_SCREEN_SIZE.x, y + GRADIATION_HEIGHT, Phaser.Color.getWebRGB(c));
|
||||||
y += GRADIATION_HEIGHT;
|
y += GRADIATION_HEIGHT;
|
||||||
}
|
}
|
||||||
console.log("final y : " + y);
|
|
||||||
|
|
||||||
var stars = game.add.group();
|
var stars = game.add.group();
|
||||||
for (var i = 0; i < 128; i++) {
|
for (var i = 0; i < 128; i++) {
|
||||||
@@ -153,17 +152,33 @@ var WordFlyingSaucer = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var GROUND_OFFSET_Y = 600;
|
var GROUND_OFFSET_Y = 600;
|
||||||
// this.tileSprite = game.add.tileSprite(50, GROUND_OFFSET_Y, GAME_SCREEN_SIZE.x + 50, GROUND_OFFSET_Y + 150, "tile_choco");
|
|
||||||
// this.tileSprite = game.add.tileSprite(300, 300, 100, 100, "tile_choco");
|
|
||||||
this.tileSprite = game.add.tileSprite(
|
this.tileSprite = game.add.tileSprite(
|
||||||
GAME_SCREEN_SIZE.x, GAME_SCREEN_SIZE.y,
|
GAME_SCREEN_SIZE.x, GAME_SCREEN_SIZE.y - 50,
|
||||||
GAME_SCREEN_SIZE.x, 200,
|
GAME_SCREEN_SIZE.x, 100,
|
||||||
"tile_choco");
|
"tile_choco");
|
||||||
this.tileSprite.anchor.set(0.5);
|
this.tileSprite.anchor.set(0.5);
|
||||||
this.tileSprite.tileScale.set(2);
|
this.tileSprite.tileScale.set(2);
|
||||||
},
|
},
|
||||||
|
|
||||||
startGame: function() {
|
startGame: function() {
|
||||||
|
this.showLevelUpText(this.gameLevelManager.getWordLevel()); // initial wordLevel = 0;
|
||||||
|
|
||||||
|
var startIndexList = [];
|
||||||
|
for(var i = 0; i < WordFlyingSaucer.MAX_FLYINGSAUCER_COUNT; i++)
|
||||||
|
startIndexList.push(i);
|
||||||
|
this.randomStartIndex = 0;
|
||||||
|
this.randomStartIndexList = Phaser.ArrayUtils.shuffle(startIndexList);
|
||||||
|
|
||||||
|
for(var i = 0; i < this.randomStartIndexList.length; i++) {
|
||||||
|
var randomDelayTime = Phaser.Timer.SECOND * 2 * i + Math.random() * Phaser.Timer.SECOND;
|
||||||
|
game.time.events.add(randomDelayTime, this.waitAndStartAttack, this);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
waitAndStartAttack: function() {
|
||||||
|
var index = this.randomStartIndexList[this.randomStartIndex];
|
||||||
|
this.flyingsaucers[index].startAttack();
|
||||||
|
this.randomStartIndex++;
|
||||||
},
|
},
|
||||||
|
|
||||||
timeOver: function() {
|
timeOver: function() {
|
||||||
@@ -224,11 +239,8 @@ var WordFlyingSaucer = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
showLevelUpText: function() {
|
showLevelUpText: function(wordLevel) {
|
||||||
if(this.centerMessageText)
|
this.centerMessageText.showText(wordLevel, this.gameLevelManager.getWordLevelText(wordLevel));
|
||||||
// this.centerMessageText.text = "";
|
|
||||||
this.centerMessageText.destroy();
|
|
||||||
this.centerMessageText = new CenterMessageText("[ " + this.gameLevelManager.getWordLevelText() + " ] 단계 활성화");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,31 @@
|
|||||||
function GameLevelManager(mainGame) {
|
function GameLevelManager(mainGame) {
|
||||||
this.mainGame = mainGame;
|
this.mainGame = mainGame;
|
||||||
|
this.extractWordManager = null;
|
||||||
|
|
||||||
this.wordLevel = 0;
|
this.wordLevel = 0;
|
||||||
|
|
||||||
this.clearedWordCountForLevel = [0, 0, 0, 0, 0, 0];
|
this.clearedWordCountForLevel = [0, 0, 0, 0, 0, 0];
|
||||||
|
}
|
||||||
|
|
||||||
|
GameLevelManager.prototype.setExtractWordManager = function(extractWordManager) {
|
||||||
|
this.extractWordManager = extractWordManager;
|
||||||
|
|
||||||
this.difficultyForLevelList = [];
|
this.difficultyForLevelList = [];
|
||||||
for(var i = 0; i < GameLevelManager.MAX_WORD_LEVEL; i++)
|
var count = this.extractWordManager.getWordLevelCount();
|
||||||
|
for(var i = 0; i < count; i++)
|
||||||
this.difficultyForLevelList[i] = ExtractWordManager.DIFFICULTY_EASY;
|
this.difficultyForLevelList[i] = ExtractWordManager.DIFFICULTY_EASY;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameLevelManager.prototype.getWordLevel = function() {
|
GameLevelManager.prototype.getWordLevel = function() {
|
||||||
|
// return this.wordLevel;
|
||||||
|
|
||||||
var randomLevel = Math.floor(Math.random() * (this.wordLevel + 1));
|
var randomLevel = Math.floor(Math.random() * (this.wordLevel + 1));
|
||||||
return randomLevel;
|
return randomLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameLevelManager.prototype.getWordLevelText = function() {
|
GameLevelManager.prototype.getWordLevelText = function(wordLevel) {
|
||||||
var wordLevelText = "";
|
var wordLevelText = "";
|
||||||
switch(this.wordLevel) {
|
switch(wordLevel) {
|
||||||
case 0:
|
case 0:
|
||||||
if(isKoreanTypingApp()) wordLevelText = "기본자리";
|
if(isKoreanTypingApp()) wordLevelText = "기본자리";
|
||||||
else wordLevelText = "Basic";
|
else wordLevelText = "Basic";
|
||||||
@@ -65,14 +73,15 @@ GameLevelManager.prototype.getDifficultyForLevel = function(wordLevel) {
|
|||||||
return this.difficultyForLevelList[wordLevel];
|
return this.difficultyForLevelList[wordLevel];
|
||||||
}
|
}
|
||||||
|
|
||||||
GameLevelManager.prototype.getStandardScore = function(wordLevel, speed) {
|
GameLevelManager.prototype.getStandardScore = function(wordLevel, difficulty, speed) {
|
||||||
return (wordLevel + 1) * (speed + 1);
|
return (wordLevel + 1) * (1 + difficulty) * (speed + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GameLevelManager.prototype.clearWord = function(wordLevel, landingRatio) {
|
GameLevelManager.prototype.clearWord = function(wordLevel, landingRatio) {
|
||||||
// console.log("====");
|
// console.log("====");
|
||||||
// for(var i = 0; i < GameLevelManager.MAX_WORD_LEVEL; i++) {
|
// var count = this.extractWordManager.getWordLevelCount();
|
||||||
|
// for(var i = 0; i < count; i++) {
|
||||||
// console.log("difficultyForLevelList[" + i + "] : " + this.difficultyForLevelList[i]);
|
// console.log("difficultyForLevelList[" + i + "] : " + this.difficultyForLevelList[i]);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@@ -81,29 +90,20 @@ GameLevelManager.prototype.clearWord = function(wordLevel, landingRatio) {
|
|||||||
|
|
||||||
this.increaseClearedWordCountForLevel(wordLevel);
|
this.increaseClearedWordCountForLevel(wordLevel);
|
||||||
|
|
||||||
if(this.wordLevel == GameLevelManager.MAX_WORD_LEVEL) {
|
|
||||||
// console.log("*** no more higher word level");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(wordLevel < this.wordLevel) {
|
|
||||||
// console.log("*** already goNextLevel");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(landingRatio < GameLevelManager.LEVEL_UP_LANDING_RATIO) {
|
if(landingRatio < GameLevelManager.LEVEL_UP_LANDING_RATIO) {
|
||||||
// console.log("*** not enough ratio");
|
// console.log("*** not enough ratio");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.goNextWordLevel();
|
this.goNextWordLevel(wordLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
GameLevelManager.prototype.increaseClearedWordCountForLevel = function(wordLevel) {
|
GameLevelManager.prototype.increaseClearedWordCountForLevel = function(wordLevel) {
|
||||||
this.clearedWordCountForLevel[wordLevel] += 1;
|
this.clearedWordCountForLevel[wordLevel] += 1;
|
||||||
|
|
||||||
// console.log("====");
|
// console.log("====");
|
||||||
// for(var i = 0; i < GameLevelManager.MAX_WORD_LEVEL; i++) {
|
// var count = this.extractWordManager.getWordLevelCount();
|
||||||
|
// for(var i = 0; i < count; i++) {
|
||||||
// console.log("clearedWordCountForLevel[" + i + "] : " + this.clearedWordCountForLevel[i]);
|
// console.log("clearedWordCountForLevel[" + i + "] : " + this.clearedWordCountForLevel[i]);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@@ -124,20 +124,53 @@ GameLevelManager.prototype.increaseClearedWordCountForLevel = function(wordLevel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GameLevelManager.prototype.goNextWordLevel = function() {
|
GameLevelManager.prototype.goNextWordLevel = function(wordLevel) {
|
||||||
this.wordLevel++;
|
if(wordLevel < this.wordLevel) {
|
||||||
|
// console.log("*** already goNextLevel");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.mainGame.showLevelUpText();
|
if(this.wordLevel < this.extractWordManager.getWordLevelCount() - 1) {
|
||||||
// console.log("goNextWordLevel to " + this.wordLevel);
|
this.wordLevel++;
|
||||||
|
this.mainGame.showLevelUpText(this.wordLevel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GameLevelManager.LEVEL_UP_LANDING_RATIO = 0.7;
|
GameLevelManager.LEVEL_UP_LANDING_RATIO = 0.7;
|
||||||
GameLevelManager.WARNING_LANDING_RATIO = 0.3;
|
GameLevelManager.WARNING_LANDING_RATIO = 0.3;
|
||||||
|
|
||||||
GameLevelManager.MAX_WORD_LEVEL = 6;
|
|
||||||
|
|
||||||
GameLevelManager.CLEARED_WORD_COUNT_FOR_NEXT_LEVEL = [15, 12, 10, 9, 8, 7];
|
GameLevelManager.CLEARED_WORD_COUNT_FOR_NEXT_LEVEL = [15, 12, 10, 9, 8, 7];
|
||||||
|
|
||||||
// GameLevelManager.KOREAN_WORD_LENGTH = [2, 3];
|
GameLevelManager.COCKPIT_COLOR_LIST = [
|
||||||
// GameLevelManager.ENGLISH_WORD_LENGTH = [3, 6];;
|
0xff66ff,
|
||||||
|
0x9966ff,
|
||||||
|
0x3399ff,
|
||||||
|
0x00ffff,
|
||||||
|
0x66ff66,
|
||||||
|
0xffff66,
|
||||||
|
0xff6633,
|
||||||
|
0xff6666
|
||||||
|
]
|
||||||
|
|
||||||
|
GameLevelManager.CENTER_MESSAGE_TEXT_COLOR_LIST = [
|
||||||
|
"#ff66ff",
|
||||||
|
"#9966ff",
|
||||||
|
"#3399ff",
|
||||||
|
"#00ffff",
|
||||||
|
"#66ff66",
|
||||||
|
"#ffff66",
|
||||||
|
"#ff6633",
|
||||||
|
"#ff6666"
|
||||||
|
]
|
||||||
|
|
||||||
|
GameLevelManager.CENTER_MESSAGE_STROKE_COLOR_LIST = [
|
||||||
|
"#662266",
|
||||||
|
"#332266",
|
||||||
|
"#113366",
|
||||||
|
"#006666",
|
||||||
|
"#226622",
|
||||||
|
"#666622",
|
||||||
|
"#662211",
|
||||||
|
"#662222"
|
||||||
|
]
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<!-- End Google Tag Manager -->
|
<!-- End Google Tag Manager -->
|
||||||
|
|
||||||
<title>격추! 비행접시 | 초코마에</title>
|
<title>격추! 비행접시 | 초코마에</title>
|
||||||
<meta name="description" CONTENT="격추! 비행접시 - 한글/영어 타자 앱 | 초코마에 ‧ Shoot down! flyingsaucer - Korean/English typing app | ChocoMae">
|
<meta name="description" CONTENT="단어 비행접시 - 한글/영어 타자 앱 | 초코마에 ‧ Word flyingsaucer - Korean/English typing app | ChocoMae">
|
||||||
|
|
||||||
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
|
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
|
||||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
||||||
|
|||||||
Reference in New Issue
Block a user