Advertisement
humpda

Score Update

Mar 8th, 2022
1,097
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. WIDTH = 500
  2. HEIGHT = 500
  3.  
  4. score = 0
  5.  
  6. def draw():
  7.     screen.clear()
  8.     screen.draw.text(f"Player 1 score: {score}", (0, 0))
  9.     screen.draw.textbox("Hello mum", Rect(50, 50, 200, 200))
  10.  
  11. # This is another special function that is called by Pygame automatically
  12. # each time a key is pressed. That way player cannot just hold down key!
  13.  
  14. def on_key_down(key):
  15.     global score
  16.     if key == keys.SPACE:
  17.         score += 1# Write your code here :-)
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement