Advertisement
CatNamedWill

Untitled

Jun 20th, 2023
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. # https://raw.githubusercontent.com/thebillington/tphysics/master/tphysics.py
  2. from tphysics import *
  3.  
  4. g = Game("Test", 600, 600, "green")
  5.  
  6. player = Rectangle(0, 0, 20, 50)
  7. player.fill_colour = "yellow"
  8.  
  9. g.add_shape(player)
  10.  
  11. while True:
  12.  
  13. if g.ispressed("Right"):
  14. player.x += 1
  15. if g.ispressed("Left"):
  16. player.x -= 1
  17. if g.ispressed("Down"):
  18. player.y -= 1
  19. if g.ispressed("Up"):
  20. player.y += 1
  21.  
  22. g.update()
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement