Fix: spaceship image in Dodge

This commit is contained in:
2019-01-17 20:42:33 +09:00
parent 7abe3cafbb
commit 41c8ced525
5 changed files with 16 additions and 30 deletions
+2 -1
View File
@@ -197,7 +197,8 @@ var Game = {
hitStarEmitter.maxParticleScale = 3;
hitStarEmitter.forEach(
function(particle) {
particle.tint = 0xadff2f;
// particle.tint = 0xadff2f;
particle.tint = 0xffa5a5;
}
);
hitStarEmitter.gravity = 0;
+1 -24
View File
@@ -30,32 +30,9 @@ var Loading = {
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
game.load.image('star', '../../../resources/image/background/star_7x7.png');
game.load.image('alien','../../../resources/image/character/alien/green_alien.png');
game.load.image('spaceship', '../../../resources/image/object/spaceship.png');
game.load.image('missile', '../../../resources/image/weapon/missile.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');
Spaceship.loadResources();
game.load.start();
},
+12 -5
View File
@@ -5,7 +5,8 @@ function Spaceship() {
this.isActivated = false;
this.speed = Spaceship.DEFAULT_SPEED;
Phaser.Sprite.call(this, game, game.world.centerX, game.world.centerY, 'alien');
Phaser.Sprite.call(this, game, game.world.centerX, game.world.centerY, 'spaceship');
this.frame = Spaceship.FRAME_NONE;
game.add.existing(this);
game.physics.arcade.enable(this);
@@ -13,7 +14,6 @@ function Spaceship() {
this.anchor.set(0.5);
this.halfWidth = this.width / 2;
// this.setActive(true);
}
@@ -44,15 +44,15 @@ Spaceship.prototype.update = function() {
Spaceship.prototype.setDirection = function(dir) {
switch(dir) {
case Spaceship.DIR_LEFT:
this.tint = 0xeeeeee;
this.frame = Spaceship.FRAME_LEFT;
break;
case Spaceship.DIR_MIDDLE:
this.tint = 0xdddddd;
this.frame = Spaceship.FRAME_NONE;
break;
case Spaceship.DIR_RIGHT:
this.tint = 0xcccccc;
this.frame = Spaceship.FRAME_RIGHT;
break;
}
}
@@ -83,6 +83,9 @@ Spaceship.prototype.goRandomPosition = function() {
}
Spaceship.loadResources = function() {
game.load.spritesheet('spaceship', '../../../resources/image/character/spaceship/spaceship.png', 32, 32);
}
Spaceship.DEFAULT_SPEED = 400;
@@ -90,3 +93,7 @@ Spaceship.DEFAULT_SPEED = 400;
Spaceship.DIR_LEFT = 0;
Spaceship.DIR_MIDDLE = 1;
Spaceship.DIR_RIGHT = 2;
Spaceship.FRAME_LEFT = 1;
Spaceship.FRAME_NONE = 2;
Spaceship.FRAME_RIGHT = 3;