Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let coin = game.createSprite(randint(0, 4), randint(0, 4))
- let player = game.createSprite(2, 2)
- game.setScore(0)
- game.startCountdown(20000)
- basic.forever(function () {
- if (player.isTouching(coin)) {
- game.setScore(game.score() + 1)
- coin.set(LedSpriteProperty.X, randint(0, 4))
- coin.set(LedSpriteProperty.Y, randint(0, 4))
- }
- if (input.acceleration(Dimension.Y) >= 0) {
- player.change(LedSpriteProperty.Y, 1)
- basic.pause(100)
- }
- if (input.acceleration(Dimension.Y) < 0) {
- player.change(LedSpriteProperty.Y, -1)
- basic.pause(100)
- }
- if (input.acceleration(Dimension.X) >= 0) {
- player.change(LedSpriteProperty.X, 1)
- basic.pause(100)
- }
- if (input.acceleration(Dimension.X) < 0) {
- player.change(LedSpriteProperty.X, -1)
- basic.pause(100)
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement