Advertisement
Mr_trove

Trove makecode

Jun 3rd, 2023
621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | Gaming | 0 0
  1. RAINFALL
  2.  
  3. def on_forever():
  4.     rain = game.create_sprite(randint(0, 4), 0)
  5.     for i in range(4):
  6.         rain.change(LedSpriteProperty.Y, 1)
  7.         basic.pause(200)
  8.     rain.delete()
  9. basic.forever(on_forever)
  10.  
  11. PLAYER :
  12. player = game.create_sprite(4, 2)
  13.  
  14. def on_button_pressed_a():
  15.     player.move(-1)
  16. input.on_button_pressed(Button.A, on_button_pressed_a)
  17.  
  18. def on_button_pressed_b():
  19.     player.move(1)
  20. input.on_button_pressed(Button.B, on_button_pressed_b)
  21.  
  22.  
  23. A IS GREATER THAN B OR ELSE:
  24. a = 100
  25. b = 20
  26. if a > b:
  27.     basic.show_string("a is greater than b")
  28.  
  29. else:
  30.     basic.show_string("b is greater or equal to a")
  31.  
  32.  
Tags: Trove
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement