Advertisement
Szczepan86

GameLab

Mar 22nd, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var balloon = createSprite(200, 200);
  2. balloon.setAnimation("balloon");
  3. balloon.scale = 0.1;
  4.  
  5. var pop = createSprite(200, 200);
  6. pop.setAnimation("pop");
  7. pop.scale = 0.6;
  8. pop.visible = false;
  9.  
  10. function draw() {
  11.   // Draw Background
  12.   background("white");
  13.  
  14.   // Update Values
  15.   balloon.scale = balloon.scale + 0.001;
  16.   console.log(balloon.scale);
  17.   if (balloon.scale >= 0.5) {
  18.     balloon.visible = false;
  19.     pop.visible = true;
  20.   }
  21.   // Draw Animations
  22.   drawSprites();
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement