Advertisement
shh_algo_PY

Adding Sprites

Feb 19th, 2022 (edited)
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. # (1) Import play
  2. import play
  3.  
  4. # (2) Create a text sprite
  5. text = play.new_text(words = 'UwU', x = -250, y = 250, font = None, font_size = 40)
  6.  
  7. # (3) Create a shape sprite
  8. cir = play.new_circle(color = 'green', x = -250, y = -250, radius=10, border_color='light green')
  9.  
  10. # (4) Create a sprite from an image
  11. pic = play.new_image(image = 'smile.png', x = 250, y = 250, size = 60, angle = 0, transparency=100)
  12.  
  13. # (5) One-time action at start
  14.  
  15. @play.when_program_starts
  16. def start():
  17.     pass
  18.     #(6) object.hide() to hide something!  
  19.     #text.hide()
  20.     #cir.hide()
  21.  
  22. # (7) Actions that run forever...
  23.  
  24. @play.repeat_forever
  25. def do():
  26.     pass
  27.  
  28. # (8) 🔊 RUN THE PROGRAM
  29.  
  30. play.start_program()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement