Fix: move card position

This commit is contained in:
2018-10-25 12:15:07 +09:00
parent b90a0d68ed
commit ac5767ccfe
4 changed files with 9 additions and 37 deletions
@@ -1,2 +1 @@
let scoreManager = new ScoreManager(); let scoreManager = new ScoreManager();
let heartManager = new HeartManager();
+5 -7
View File
@@ -1,4 +1,7 @@
DudeCard = function(game, col, row, cardCharacters, clickedHandler) { DudeCard.prototype = Object.create(Phaser.Sprite.prototype);
DudeCard.prototype.constructor = DudeCard;
function DudeCard(game, col, row, cardCharacters, clickedHandler) {
this.cardIndex = row * DudeCard.MAX_CARD_COLUMN_NO + col; this.cardIndex = row * DudeCard.MAX_CARD_COLUMN_NO + col;
this.columnNo = col; this.columnNo = col;
this.rowNo = row; this.rowNo = row;
@@ -34,11 +37,6 @@ DudeCard = function(game, col, row, cardCharacters, clickedHandler) {
game.add.existing(this); game.add.existing(this);
} }
DudeCard.prototype = Object.create(Phaser.Sprite.prototype);
DudeCard.prototype.constructor = DudeCard;
DudeCard.prototype.update = function() {
}
DudeCard.prototype.onDown = function(sprite) { DudeCard.prototype.onDown = function(sprite) {
if(this.isActivated == false) if(this.isActivated == false)
return; return;
@@ -102,7 +100,7 @@ DudeCard.prototype.show = function(openCardColumnNo, openCardRowNo) {
this.alpha = 1; this.alpha = 1;
this.x = game.world.centerX - (((openCardColumnNo - 1) / 2) - this.columnNo) * 180; this.x = game.world.centerX - (((openCardColumnNo - 1) / 2) - this.columnNo) * 180;
this.y = game.world.centerY + 70 - (((openCardRowNo - 1) / 2) - this.rowNo) * 160; this.y = game.world.centerY - (((openCardRowNo - 1) / 2) - this.rowNo) * 160;
} }
DudeCard.prototype.hide = function() { DudeCard.prototype.hide = function() {
+4 -25
View File
@@ -38,9 +38,8 @@ var Game = {
this.stageTimer = new StageTimer( this.stageTimer = new StageTimer(
Game.GAME_TIME_SEC, Game.GAME_TIME_SEC,
(function() { (function() {
// self.isOnStage = false; // this.isOnStage = false;
// self.goResult();
this.gameOver(); this.gameOver();
}).bind(this) }).bind(this)
); );
@@ -100,9 +99,6 @@ var Game = {
this.popupTween = null; this.popupTween = null;
this.startButton; this.startButton;
// this.leftTimeText;
// this.leftTimeSec;
this.timeEvent; this.timeEvent;
this.gameTimeEvents = []; this.gameTimeEvents = [];
@@ -159,6 +155,7 @@ var Game = {
location.href = '../../web/client/menu_app.html'; location.href = '../../web/client/menu_app.html';
}, },
/*
countDown() { countDown() {
const style = { font: "bold 200px Arial", fill: "#fff", boundsAlignH: "center", boundsAlignV: "middle" }; const style = { font: "bold 200px Arial", fill: "#fff", boundsAlignH: "center", boundsAlignV: "middle" };
this.countDownText = game.add.text(0, 0, "", style); this.countDownText = game.add.text(0, 0, "", style);
@@ -187,10 +184,10 @@ var Game = {
this.countDownNumber--; this.countDownNumber--;
}, },
*/
startGame: function() { startGame: function() {
this.playingStageNo = 1; this.playingStageNo = 1;
// this.leftTimeSec = 0; // INIT_LEFT_TIME_MIN * 60;
this.startStage(); this.startStage();
this.stageTimer.start(); this.stageTimer.start();
@@ -205,24 +202,6 @@ var Game = {
this.initCards(); this.initCards();
this.initOpenCardInfo(); this.initOpenCardInfo();
/*
var bonusTime = this.getBonusTime();
if(this.playingStageNo == 1)
this.showStageNotice(this.playingStageNo + "단계 시작 (제한 시간 : " + this.bonusTime + "초)");
else if(this.bonusTime == 0)
this.showStageNotice(this.playingStageNo + "단계 시작");
else
this.showStageNotice(this.playingStageNo + "단계 시작 (보너스 +" + this.bonusTime + "초)");
this.leftTimeSec += this.bonusTime;
*/
// this.leftTimeSec = Game.GAME_TIME_SEC;
// this.updateLeftTime();
// if(this.playingStageNo == 1)
// this.timeEvent = game.time.events.loop(1000, this.updateLeftTime, this);
}, },
setOpenCardColumnRow() { setOpenCardColumnRow() {
@@ -554,5 +533,5 @@ var Game = {
} }
Game.GAME_TIME_SEC = 6; Game.GAME_TIME_SEC = 60;
Game.GAME_OVER_WAIT_TIME_MS = 2000; Game.GAME_OVER_WAIT_TIME_MS = 2000;
@@ -1,4 +0,0 @@
function animateTextAlpha(targetText, startAlpha, endAlpha, msTime, effectType) {
targetText.alpha = startAlpha;
game.add.tween(targetText).to({alpha: endAlpha}, msTime, effectType, true);
}