leeanneb / FruitySpace

A space invaders game created by Unity. I created a spaceship which will be controlled by a user and it will have to hit all the aliens in the game to win. The spaceship can only move left and right and fire the bullets to the aliens. The aliens also will shoot the bullets to the space ship and the more the level goes up the more aliens will increase. When the aliens hit the spaceship, its health will decrease with -5, and when the health is 0, it will automaticly goes to the "Game Over". But when the user wins the game, it will goes in the "You Win".
0 stars 0 forks source link

health is decreasing by 1 instead of 5 #1

Open leeanneb opened 11 years ago

leeanneb commented 11 years ago

Error: if (other.gameObject.tag=="enemylaser") { // pinapple spaceship is hit and it is going to change colors this.renderer.material = colours[1]; health-=1; }

leeanneb commented 11 years ago

Fixed Error:

if (other.gameObject.tag=="enemylaser")
{
    // pinapple spaceship is hit and it is going to change colors 
    this.renderer.material = colours[1];
    health-=5;
}

I fixed the health by arranging the number to "-=5"