-
Notifications
You must be signed in to change notification settings - Fork 0
/
interaction.py
30 lines (25 loc) · 944 Bytes
/
interaction.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
27
28
29
30
import pygame, sys
from object_classes import *
def interaction(fish, state, FPS, scrollbar_str, score):
for event in pygame.event.get():
if event.type == pygame.QUIT or event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE:
pygame.quit()
sys.exit()
if event.type == pygame.KEYDOWN and event.key == pygame.K_UP:
fish.moveup()
if event.type == pygame.KEYDOWN and event.key == pygame.K_DOWN:
fish.movedown()
if event.type == pygame.KEYDOWN and event.key == pygame.K_SPACE:
fish.restart(FPS)
Obstacle.ObstacleList = []
ScrollBar.BarList = []
Bubble.BubbleList = []
bar = ScrollBar(scrollbar_str)
standingstillbar = ScrollBar(scrollbar_str, 0, 0, 96, True)
score = 0
"""
ADD:
- Screenshot?
- Pause button?
"""
return score