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

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -