03-01-hiding-ninjas.js 409 B

1234567891011
  1. //Scene Object: Initialize When Scene Starts Event
  2. ninja.toggleVisible(); //we are exploring booleans, toggles are like light switches, it is either on or off
  3. if($this.scene.state()=="PLAY"){
  4. var ninjaTime1=random(3000,1000);
  5. createTimer(ninjaTime1,function(){
  6. ninja.toggleVisible(); //since we are switching it off when we start the game, this timer is turning it off
  7. });
  8. }