x


gui textures not updating

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?

more ▼

asked Feb 07 '12 at 06:28 AM

cman19 gravatar image

cman19
16 2 4 7

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3678
x475
x14

asked: Feb 07 '12 at 06:28 AM

Seen: 366 times

Last Updated: Feb 07 '12 at 06:28 AM