Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var salt = createSprite (200, 200);
- salt.setAnimation("Salt.jpg");
- salt.rotation = 150;
- ellipse(200, 200, 400, 400);
- z = 0;
- x = 0;
- y = 0;
- j = 0;
- function draw() {
- background("#00c5ff");
- var mousex = World.mousex;
- // If mouseDidMove, rotate the salt shaker randomly to the left or righ
- if (mouseDidMove()){
- salt.rotation = salt.rotation + randomNumber(-1, 1);
- playSound("Salt_Shaker_SOUND_EFFECT_-_Salzstreuer_SOUND-ZZzBILozlGU.mp3", false);
- z++;
- x++;
- j++;
- y++;
- } else {
- salt.rotation = 150;
- stopSound("Salt_Shaker_SOUND_EFFECT_-_Salzstreuer_SOUND-ZZzBILozlGU.mp3")
- }
- if (z < 30){
- var pile = createSprite (300, 200);
- pile.setAnimation("Pile.jpg");
- var square = createSprite(300,400)
- square.setAnimation("square")
- square.scale = 1;
- square.height = 300;
- square.width = 400;
- pile.scale = 4;
- drawSprites()
- } else if(j == 30) {
- var square2 = createSprite(300,400)
- square2.setAnimation("square")
- square2.scale = 1;
- square2.height = 300;
- square2.width = 400;
- var pile = createSprite (300, 200);
- pile.setAnimation("Pile.jpg");
- var squares = createSprite(300,300)
- squares.setAnimation("square")
- squares.scale = 1;
- squares.height = 100;
- squares.width = 400;
- pile.scale = 4;
- } else if (x == 60){
- var square3 = createSprite(300,400)
- square3.setAnimation("square")
- square3.scale = 1;
- square3.height = 300;
- square3.width = 400;
- var pile = createSprite (300, 200);
- pile.setAnimation("Pile.jpg");
- pile.scale = 4;
- var square = createSprite(300,100)
- square.setAnimation("square")
- square.scale = 1;
- square.height = 100;
- square.width = 400;
- drawSprites()
- }
- drawSprites();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement