Guest User

Untitled

a guest
Feb 15th, 2021
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. let coin = game.createSprite(randint(0, 4), randint(0, 4))
  3. let player = game.createSprite(2, 2)
  4. game.setScore(0)
  5. game.startCountdown(20000)
  6. basic.forever(function () {
  7.     if (player.isTouching(coin)) {
  8.         game.setScore(game.score() + 1)
  9.         coin.set(LedSpriteProperty.X, randint(0, 4))
  10.         coin.set(LedSpriteProperty.Y, randint(0, 4))
  11.     }
  12.     if (input.acceleration(Dimension.Y) >= 0) {
  13.         player.change(LedSpriteProperty.Y, 1)
  14.         basic.pause(100)
  15.     }
  16.     if (input.acceleration(Dimension.Y) < 0) {
  17.         player.change(LedSpriteProperty.Y, -1)
  18.         basic.pause(100)
  19.     }
  20.     if (input.acceleration(Dimension.X) >= 0) {
  21.         player.change(LedSpriteProperty.X, 1)
  22.         basic.pause(100)
  23.     }
  24.     if (input.acceleration(Dimension.X) < 0) {
  25.         player.change(LedSpriteProperty.X, -1)
  26.         basic.pause(100)
  27.     }
  28. })
  29.  
Advertisement
Add Comment
Please, Sign In to add comment