repl.it
@heyitsmarcus/

Test-Pygame

Pygame

No description

fork
loading
Files
  • main.py
  • nohup.out
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import play

cat = play.new_text('=^.^=', font_size=70)

@play.repeat_forever
async def move_cat():
    cat.x = play.random_number(-200, 200)
    cat.y = play.random_number(-200, 200)
    cat.color = play.random_color()
    
    cat.show()

    await play.timer(seconds=0.6)

    cat.hide()

    await play.timer(seconds=0.6)

# click the cat to win the game!
@cat.when_clicked
def win_function():
    cat.show()
    cat.words = 'You won!'


play.start_program()