|
here is my code:var health1 : Texture2D;//one life left var health2 : Texture2D;//two lives left var health3 : Texture2D;// max lives public static var LIVES = 3; static var HITS = 0; function Update () { print("lives: " +LIVES+" Hits " +HITS); switch(LIVES) { case 3: GUITexture.Texture = health3; break; case 2: GUITexture.Texture = health2; break; case 1: GUITexture.Texture = health1; break; case 0: //gameover script placeholder break; } switch(HITS) { case 1: break; case 2: break; case 3: LIVES -= 1; Hits = 0; movearound.dead = true; break; } } .... now what im doing is that after three hits i want to update my health textures from 3 hearts to two but it keeps going past lives in the negatives and the hit counter keeps going up without updating my textures. any ideas on how to fix this?
(comments are locked)
|
