-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpaceshipAdventure.py
33 lines (26 loc) · 1002 Bytes
/
SpaceshipAdventure.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
31
32
33
import pygame
import CONFIG
from game_mouse import Game
from SpaceshipData import SpaceshipData
class SpaceshipAdventure(Game):
def __init__(self, width, height, frame_rate):
self.newGame(width,height,frame_rate)
return
def game_logic(self, keys, newkeys, buttons, newbuttons, mouse_position):
self.data.evolve(keys, newkeys, buttons, newbuttons, mouse_position)
return
def paint(self, surface):
if CONFIG.GAME_STATE == 2:
self.data.draw(surface)
elif CONFIG.GAME_STATE == 1:
self.data.loadDraw(surface)
elif CONFIG.GAME_STATE == 0:
self.data.menuDraw(surface)
return
def newGame(self,width, height, frame_rate):
self.width = width
self.height = height
self.frame_rate = frame_rate
Game.__init__(self, "Kimber's Space Adventure", width, height, frame_rate)
self.data = SpaceshipData(width,height,frame_rate)
return