aff
This commit is contained in:
parent
c9413c4aff
commit
201c37d442
1 changed files with 9 additions and 3 deletions
12
main.py
12
main.py
|
@ -64,12 +64,13 @@ boden = (screensize[1]//3)*2
|
|||
|
||||
player = Player()
|
||||
Kaktuse = []
|
||||
kaktus_ticker = 0
|
||||
next_kaktus = randint(100,500)
|
||||
for a in range(3):
|
||||
Kaktuse.append(Kaktus())
|
||||
kaktusspeed = 5
|
||||
show_debug = False
|
||||
running = True
|
||||
kaktus_ticker = 0
|
||||
if __name__ == "__main__":
|
||||
while running:
|
||||
## key managment
|
||||
|
@ -81,7 +82,6 @@ if __name__ == "__main__":
|
|||
show_debug = not show_debug
|
||||
if pressed_keys[pygame.K_SPACE] and not preview_pressed_keys[pygame.K_SPACE]:
|
||||
player.jump()
|
||||
Kaktuse.append(Kaktus())
|
||||
|
||||
preview_pressed_keys = pressed_keys
|
||||
## event managment
|
||||
|
@ -97,7 +97,13 @@ if __name__ == "__main__":
|
|||
for a in Kaktuse:
|
||||
a.move(kaktusspeed)
|
||||
a.render()
|
||||
kaktus_ticker += 1
|
||||
if a.pos[0] < 0:
|
||||
Kaktuse.pop(0)
|
||||
if kaktus_ticker > next_kaktus:
|
||||
next_kaktus = randint(80,180)
|
||||
kaktus_ticker =0
|
||||
Kaktuse.append(Kaktus())
|
||||
kaktus_ticker += kaktusspeed*0.3
|
||||
if show_debug:
|
||||
get_debug_text()
|
||||
## bildschirm aktuallisierung
|
||||
|
|
Loading…
Reference in a new issue