I am trying to make a space invaders like game, but the bullet will stop after I fire another, which seems rather unusable, although it would provide an interesting aspect to the game. CodeName_Flier1-Dec18-2018-6.28PM.wick (3.0 KB)
var active = false;
var bullet_speed = 15;
this.opacity = 0;
var spaced = false;
function update() {
if (active === false){
this.opacity = 0;
}
if (active){
this.opacity = 1
this.y -= bullet_speed;
this.clone.y -= bullet_speed;
}
}
function keyPressed(key) {
if (keyIsDown('Space')){
var spaced = true;
var clone = this.clone();
this.y = Flier1.y;
this.x = Flier1.x;
active = true;
}
}
P.S. the similar topic thing on the left when you make a topic is rather handy. . .