-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblah.py
executable file
·88 lines (59 loc) · 2 KB
/
blah.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env python
import pygame, sys
from pygame.locals import *
from stackframe import StackFrame, runStack
from board import Board, Tile, Enemy, Clerk, Creature, Player
from gameplayFrame import GameplayFrame
from menuFrame import MenuTree
from menus import gameMenuTree, mainMenuTree
from animationRender import Animation
def initGraphics():
pygame.init()
window = pygame.display.set_mode((600,600), pygame.DOUBLEBUF, 32)
pygame.display.set_caption('72 --- Death of One, Death of Many')
return window
def initSound():
pygame.mixer.init(frequency=44100, size=-16, channels=2, buffer=4096)
def gameFrame(window, stack):
# b = Board(None, filename='media/maps/test')
b = Board((20,20))
for x in range(0,20):
for y in range(0,20):
b.spaces[x][y] = Tile('media/tileproto1.png', [])
p = Player(20, 10, None, None, None, 4)
p.makeRenderable(window)
b.placeEntity(p, 3, 4)
b.placeEntity(Clerk(20, 10, None, 'redneck'), 5,5)
return GameplayFrame(stack, window, b, p)
def main():
stack = []
initSound()
window = initGraphics()
fpsClock = pygame.time.Clock()
stack.append(mainMenuTree(stack, window, gameFrame(window, stack)));
while True:
window.fill(pygame.Color(255,255,255))
if not runStack(stack):
break
pygame.display.update()
fpsClock.tick(30)
return
if __name__=='__main__':
main()
def main2():
stack = []
initSound()
window = initGraphics()
fpsClock = pygame.time.Clock()
# stack.append(mainMenuTree(stack, window, gameFrame(window, stack)));
testAnim = Animation(window)
while True:
window.fill(pygame.Color(255,255,255))
# if not runStack(stack):
# break
testAnim.update()
testAnim.render((300, 300))
testAnim.paint()
pygame.display.update()
fpsClock.tick(30)
return