forked from techwithtim/Golf-Game
-
Notifications
You must be signed in to change notification settings - Fork 0
/
courses.py
46 lines (35 loc) · 5.62 KB
/
courses.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
winheight = 600
winwidth = 1080
lvl1 = [[0, -8, 1200, 24, 'floor'], [100, 100, 32, 32, 'coin', True],[952, winheight - 8, 128, 8, 'green'], [0, winheight - 8, winwidth - 128, 100, 'floor'], [-8, 0, 16, winheight + 100, 'wall'], [280, 350, 64, 64, 'sand'], [520, 350, 256, 16, 'floor'], [0, 152, 128, 16, 'floor'], [344, 152, 16, 448, 'wall'], [winwidth - 8, 0, 16, winheight + 100, 'wall'], [936, 320, 16, 320, 'wall'], [880, winheight - 8, 64, 8, 'floor'], [360, 560, 576, 32, 'water'],[1006, winheight - 68, 64, 64, 'flag'], [5, (180, winheight - 12)]]
lvl2 = [[0, -8, 1200, 24, 'floor'], [968, winheight - 8, 300, 16, 'floor'], [-8, 0, 16, winheight + 100, 'wall'], [-40, winheight - 8, 900, 16, 'floor'], [128, winheight - 128, 16, 128, 'wall'], [144, winheight - 38, 704, 32, 'water'], [420, 350, 128, 64, 'sand'], [470, 300, 32, 32, 'coin', True], [winwidth - 8, 0, 16, winheight + 100, 'wall'], [848, 300, 16, 500, 'wall'], [864, 364, 128, 16, 'floor'], [992, 300, 16, 192, 'wall'], [864, 332, 128, 32, 'water'], [860, winheight - 8, 128, 8, 'green'], [900, winheight - 68, 64, 64, 'flag'],[4, (50, winheight - 12)]]
lvl3 = [[0, 100, 128, 16, 'floor'], [500, winheight - 8, 192, 8, 'green'], [600, winheight-68, 64, 64, 'flag'], [590, 400, 32, 32, 'coin', True], [-8, -400, 16, winheight + 500, 'wall'],[484, winheight - 128, 16, 128, 'wall'], [692, winheight - 128, 16, 128, 'wall'], [708, winheight - 38, 128, 32, 'water'], [winwidth - 8, 0, 16, winheight + 100, 'wall'], [356, winheight - 38, 128, 32, 'water'], [-12, winheight-8, 512, 16, 'floor'], [708, winheight - 8, 600, 32, 'floor'], [836, winheight-64, 500, 64, 'sand'], [-28, winheight-64, 400, 64, 'sand'], [3, (50, 95)]]
lvl4 = [[0, winheight - 8, winwidth + 64, 100, 'floor'], [550, 300, 32, 32, 'coin', True], [0, winheight - 40, 1200, 32, 'water'], [50, 450, 128, 16, 'floor'], [-8, 0, 16, winheight + 100, 'wall'], [winwidth - 128, 450, 128, 8, "green"], [winwidth - 128, 458, 128, 16, "floor"], [winwidth-80, 388, 64, 64, 'flag'], [winwidth - 8, 0, 16, winheight + 100, 'wall'], [3, (120, 446)]]
lvl5 = [[800, 400, 32, 32, 'coin', True], [0, winheight - 8, winwidth + 64, 100, 'floor'], [-8, 0, 16, winheight + 100, 'wall'], [winwidth - 8, 0, 16, winheight + 100, 'wall'], [0, 400, 128, 16, 'floor'], [128, 118, 16, 600, 'wall'], [144, 152, 128, 32, 'water'], [144, 184, 192, 16, 'floor'], [256, 120, 64, 64, 'sand'], [winwidth-200, 164, 192, 8, 'green'], [winwidth-216, 164, 16, 64, 'wall'], [752, 528, 320, 64, 'sand'], [736, 0, 16, 270, 'wall'], [winwidth-200, 172, 192, 16, 'floor'], [0, -8, 1200, 16, 'floor'], [8, 200, 64, 64, 'sand'], [winwidth-108, 104, 64, 64, 'flag'], [5, (50, 395)]]
lvl6 = [[200, 136, 1000, 32, 'water'], [475, 284, 64, 16, 'floor'],[523, 300, 16, 500, 'wall'],[500, 300, 15, 500, 'laser'], [490, 250, 32, 32, 'coin', True], [0, 120, 64, 64 ,'sand'], [0, 450, 200, 16, 'floor'], [184, 120, 16, 64, 'wall'],[0, winheight - 8, winwidth + 64, 100, 'floor'], [-8, 0, 16, winheight + 100, 'wall'], [814, 124, 400, 16, 'floor'],[winwidth - 8, 0, 16, winheight + 100, 'wall'], [winwidth-13, 340, 16, 128, 'sticky'], [winwidth-250, 400, 128, 16, 'green'], [winwidth-250, 408, 128, 16, 'floor'], [winwidth -200, 338, 64, 64, 'flag'], [200, 168, 1000, 16, 'floor'],[winwidth-266, 168, 16, 260, 'wall'], [winwidth-266, 128, 16, 64, 'wall'], [5, (920, 120)]]
lvl7 = [[0, 560, 1200, 32, 'water'], [0, 300, 128, 16, 'floor'], [0, 490, 192, 16, 'floor'], [128, 450, 192, 16, 'floor'], [344, 268, 16, 192, 'wall'], [360, 380, 192, 64, 'sand'], [0, winheight - 8, winwidth + 64, 100, 'floor'], [0, -8, 1200, 16, 'floor'], [-8, 0, 16, 700, 'wall'], [winwidth - 8, 0, 16, 700, 'wall'], [700, 150, 192, 16, 'floor'], [780, 110, 32, 32, 'coin', True], [winwidth-200, 500, 128, 16, 'green'], [winwidth-200, 508, 128, 16, 'floor'], [winwidth-13, 300, 16, 192, 'sticky'], [winwidth - 140, 438, 64, 64, 'flag'],(4, (50, 485))]
lvl8 = [[400, 560, 800, 32, 'water'], [0, winheight - 8, winwidth + 64, 100, 'floor'], [-8, 0, 16, winheight + 100, 'wall'], [winwidth - 8, 0, 16, winheight + 100, 'wall'], [0,-8, 1200, 16, 'floor'], [winwidth - 134, 200, 128, 8, 'green'], [winwidth - 134, 208, 128, 16, 'floor'], [winwidth - 326, 200, 192, 32, 'water'], [winwidth - 340, 176, 16, 64, 'wall'], [winwidth - 326, -32, 16, 128, 'wall'], [400, 200, 16, 550, 'wall'], [150, 300, 64, 64, 'sand'], [540, 190, 128, 64, 'sand'], [574, 150, 32, 32, 'coin', True], [370, 184, 64, 16, 'floor'],[390, 200, 16, 550, 'laser'], [0, 500, 64, 16, 'floor'],[272, 440, 128, 16, 'floor'], [winwidth - 326, 224, 400, 16, 'floor'],[winwidth - 68, 140, 64, 64, 'flag'], [6, (200, 588)]]
lvl9 = [[0, winheight-36, 1200, 32, 'water'], [-8,0,16, 700, 'wall'], [winwidth-8, 0, 16, 700, 'wall'], [0, -8, 1200, 16, 'floor'], [0,winheight-8,1200, 16, 'floor'], [0, 500, 128, 16, 'floor'], [350, 375, 128, 64, 'sand'],[700, 250, 64, 64, 'sand'], [winwidth -198, 150, 200, 8, 'green'], [winwidth -198, 158, 200, 8, 'floor'],[550, 230, 32, 32, 'coin', True],[winwidth-80, 90, 64, 64, 'flag'], [5, (64, 496)]]
course1 = [lvl1, lvl2, lvl3, lvl4, lvl5, lvl6, lvl7, lvl8, lvl9]
def getLvl(n=1):
return course1[n - 1][:-1]
def getPar(course=1):
if course == 1:
count = []
for x in range(9):
if x < len(course1):
l = course1[x][-1]
par = l[0]
count.append(par)
else:
count.append(0)
return count
def getStart(lvl, course=1):
if course == 1:
pos = course1[lvl - 1][-1]
nPos = pos[-1]
return nPos
def coinHit(lvl):
for x in course1[lvl]:
if len(x) > 4:
if x[4] == 'coin':
x[5] = False