-
Notifications
You must be signed in to change notification settings - Fork 0
/
Adventure.py
56 lines (44 loc) · 1.72 KB
/
Adventure.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import pygame
import dynamicConfig
from game_mouse import Game
from Data import Data
from menuData import Data as menuData
from RaindanceData import RaindanceData
from DeathData import DeadData
from chugData import Data as chugData
from Blondness_in_the_trees import Data as blondData
class Adventure(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.bigData.evolve(keys, newkeys, buttons, newbuttons, mouse_position)
if dynamicConfig.paused == False:
self.data.evolve(keys, newkeys, buttons, newbuttons, mouse_position)
return
def paint(self, surface):
self.bigData.draw(surface)
self.data.draw(surface)
if dynamicConfig.paused == True:
self.bigData.drawPaused(surface)
return
def newGame(self,width, height, frame_rate):
global data
name = 'CodeCamp2015'
self.width = width
self.height = height
self.frame_rate = frame_rate
if dynamicConfig.whatGame == 0:
data = menuData(width, height, frame_rate)
elif dynamicConfig.whatGame == 1:
data = RaindanceData(width, height, frame_rate)
elif dynamicConfig.whatGame == 2:
data = blondData(width,height,frame_rate)
elif dynamicConfig.whatGame == 3:
data = chugData(width, height, frame_rate)
elif dynamicConfig.whatGame == 99:
data = DeadData(width,height,frame_rate)
Game.__init__(self, name, width, height, frame_rate)
self.data = data
self.bigData = Data(width,height, frame_rate)
return