-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathl.py
More file actions
34 lines (33 loc) · 750 Bytes
/
Copy pathl.py
File metadata and controls
34 lines (33 loc) · 750 Bytes
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
27
28
29
30
31
32
33
34
from random import randint
import sys
import pgzrun
HEIGHT=700
WIDTH=700
Bienen=Actor("biene")
Margarita=Actor("margarita")
Bienen.pos=100,50
Margarita.pos=30,10
Punkten=0
Game_over=False
def draw():
screen.blit("wald", (0,0))
Bienen.draw()
Margarita.draw()
screen.draw.text("score:" + str(Punkten),(600,600))
def update():
global Punkten
if keyboard.left:
Bienen.x-=5
if keyboard.right:
Bienen.x+=5
if keyboard.up:
Bienen.y-=5
if keyboard.down:
Bienen.y+=5
if Bienen.colliderect(Margarita):
Punkten=Punkten+1
Margarita_beliebiges_Platzieren()
def Margarita_beliebiges_Platzieren():
Margarita.x=randint(100,600)
Margarita.y=randint(100,600)
pgzrun.go()