Add: flyingsaucer image
This commit is contained in:
@@ -11,7 +11,26 @@ var WordFlyingSaucer = {
|
||||
(function() { this.timeOver(); }).bind(this)
|
||||
);
|
||||
|
||||
game.stage.backgroundColor = '#4d4d4d';
|
||||
this.initVariables();
|
||||
|
||||
|
||||
|
||||
// game stage
|
||||
this.game.stage.backgroundColor = "#000000"; // '#4d4d4d';
|
||||
var stars = game.add.group();
|
||||
for (var i = 0; i < 128; i++) {
|
||||
var randomY = game.rnd.integerInRange(60, GAME_SCREEN_SIZE.y - 80);
|
||||
stars.create(game.world.randomX, randomY, 'star');
|
||||
}
|
||||
|
||||
this.flyingsaucers = [];
|
||||
for(var i = 0; i < 2; i++) {
|
||||
this.flyingsaucers[i] = new FlyingSaucer(i);
|
||||
this.flyingsaucers[i].setup(this.wordLevel, this.speedLevel);
|
||||
this.flyingsaucers[i].setActive(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// top ui
|
||||
var screenTopUI = new ScreenTopUI();
|
||||
@@ -44,14 +63,6 @@ var WordFlyingSaucer = {
|
||||
heartGauge.start();
|
||||
|
||||
|
||||
this.initVariables();
|
||||
|
||||
for(var i = 0; i < 10; i++) {
|
||||
var flyingsaucer = new FlyingSaucer(i);
|
||||
flyingsaucer.setup(this.wordLevel, this.speedLevel);
|
||||
flyingsaucer.setActive(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// input text
|
||||
@@ -124,32 +135,18 @@ var WordFlyingSaucer = {
|
||||
|
||||
|
||||
checkTypingContents: function(event) {
|
||||
var count = this.flyingsaucers.length;
|
||||
if(event.keyCode == Phaser.Keyboard.ENTER) {
|
||||
// console.log("### enter ###");
|
||||
var inputContent = this.inputText.canvasInput.value();
|
||||
/*
|
||||
var typingContent = this.typingRandomContents[this.typingIndex];
|
||||
|
||||
if(inputContent === typingContent) {
|
||||
this.calculateTypingRecord(typingContent);
|
||||
this.playNextContent();
|
||||
|
||||
if(this.typingIndex == this.typingContentLength)
|
||||
this.gameOver();
|
||||
// this.goResult();
|
||||
// this.state.start('TypingTestResult');
|
||||
}
|
||||
*/
|
||||
}
|
||||
else {
|
||||
/*
|
||||
if(this.isTyping == false) {
|
||||
// console.log(event);
|
||||
this.setTimeTypingStart();
|
||||
for(var i = 0; i < count; i++) {
|
||||
this.flyingsaucers[i].attack(this.inputText.canvasInput.value());
|
||||
}
|
||||
|
||||
this.showTypingContentHighlight();
|
||||
*/
|
||||
this.inputText.canvasInput.value("");
|
||||
} else {
|
||||
|
||||
for(var i = 0; i < count; i++) {
|
||||
this.flyingsaucers[i].checkInputText(this.inputText.canvasInput.value());
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user