actionscript 3 - Can't find a way to add Game Over in my flash game as3 -


so followed tutorial asgamer flash game. finished tutorial , cant find way how make game when ship goes 0 health must take screen saying game over.i tried code how game on as3 confused how write code ( used as3 classes).

add vars  var skills:number; var spoints:number;  add health deduction function  if (health <= 0 && lives <=0) { skills = kills; spoints = points; die(); }  add function anywhere  function die(); kills = 0; points = 0; health = 100; lives = 10; //basically reset game values besides skills , spoints gotoandstop("gameover"); } 

i have severall as3 classes engine ship enemyufo dont know insert code in class


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -