| 12345678910111213141516171819202122 |
- //Scene - Initialize When Scene Starts
- //Raindrop is from the last activity, we have
- //moved it to the scene
- if($this.scene.state() == "PLAY"){
- createTimer(1000, function(){
- var ndrop = drop.clone();
- var rainx = random(760,40);
- ndrop.x(rainx);
- ndrop.y(10);
- });
- //Lightning bolt cloning is very much the same
- //as cloning the rain drop
- createTimer(5000, function(){
- //insert clone code here
- var nbolt = bolt.clone();
- var boltX = random(760,40);
- nbolt.x(boltX);
- nbolt.y(10);
-
-
- });
- }
|