Advertisement
humpda

Timer_Example

Mar 8th, 2022
1,186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. # Write your code here :-)
  2. timer = 0
  3.  
  4. def update(dt):
  5.     global timer
  6.     timer += dt
  7.  
  8.  
  9. def draw():
  10.     screen.clear()
  11.     screen.draw.text(f"Time passed: {timer}", (0, 0))
  12.     if timer > 5:
  13.         screen.draw.textbox("Time's up!", Rect(50, 50, 200, 200))
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement