diff --git a/images/map_thumbnail/map4.png b/images/map_thumbnail/map4.png new file mode 100644 index 0000000..56218d9 Binary files /dev/null and b/images/map_thumbnail/map4.png differ diff --git a/main.py b/main.py index b696148..38a4e6c 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,4 @@ from gameManager import * +from game import * GameManager() \ No newline at end of file diff --git a/map.py b/map.py index ae3c99d..05b730c 100644 --- a/map.py +++ b/map.py @@ -11,6 +11,8 @@ def generate_map(id): return map2() elif id == 3: return map3() + elif id == 4: + return map4() else: return no_map() @@ -97,4 +99,56 @@ def map3(): blocks.append(Block(SCREEN_WIDTH - (SCREEN_WIDTH/16 - SCREEN_WIDTH/80) - SCREEN_WIDTH/20, SCREEN_HEIGHT/10, SCREEN_WIDTH/20, SCREEN_HEIGHT/30, Color.YELLOW.value, type="win")) + return blocks + + +def map4(): + blocks=[] + + blocks.append(Block(SCREEN_WIDTH/16 - SCREEN_WIDTH/80, SCREEN_HEIGHT-SCREEN_HEIGHT/15, SCREEN_WIDTH/20, SCREEN_HEIGHT/30, Color.LIGHT_GREY.value, type="spawn")) #spawn point + blocks.append(Block(0, SCREEN_HEIGHT-SCREEN_HEIGHT/30, SCREEN_WIDTH, SCREEN_HEIGHT/30, Color.RED.value, type="lava")) #ground + blocks.append(Block(SCREEN_WIDTH - SCREEN_WIDTH/10, SCREEN_HEIGHT*2/15, SCREEN_WIDTH/10, SCREEN_HEIGHT*13/15,Color.RED.value, type="lava")) + + #verticals + blocks.append(Block(SCREEN_WIDTH/4, SCREEN_HEIGHT/8, SCREEN_WIDTH/40, SCREEN_HEIGHT*7/8 - SCREEN_HEIGHT/30,Color.BLUE.value)) + blocks.append(Block(SCREEN_WIDTH/2, 0, SCREEN_WIDTH/40, SCREEN_HEIGHT*7/8 - SCREEN_HEIGHT/30,Color.BLUE.value)) + + #jump 1st part + blocks.append(Block(SCREEN_WIDTH/4 - SCREEN_WIDTH * 3/32, SCREEN_HEIGHT*3/4 + SCREEN_HEIGHT/30, SCREEN_WIDTH/16, SCREEN_HEIGHT/30, Color.BURGUNDY.value, type="jump")) + blocks.append(Block(PLAYER_WIDTH*2, SCREEN_HEIGHT*3/8 + SCREEN_HEIGHT/20 + SCREEN_HEIGHT/30, SCREEN_WIDTH/16, SCREEN_HEIGHT/30, Color.BURGUNDY.value, type="jump")) + + #lava in air + length_between_vertical = SCREEN_WIDTH/4 - SCREEN_WIDTH/40 + #1st floor + blocks.append(Block(SCREEN_WIDTH/4 + SCREEN_WIDTH/40, SCREEN_HEIGHT/4, length_between_vertical/4, SCREEN_HEIGHT/30,Color.RED.value, type="lava")) + blocks.append(Block(SCREEN_WIDTH/4 + SCREEN_WIDTH/40 + length_between_vertical/2, SCREEN_HEIGHT/4, length_between_vertical/2, SCREEN_HEIGHT/30,Color.RED.value, type="lava")) + #interfloor + blocks.append(Block(SCREEN_WIDTH/4 + SCREEN_WIDTH/40 + length_between_vertical/4, SCREEN_HEIGHT*3/8, length_between_vertical/4, SCREEN_HEIGHT/30,Color.BLUE.value)) + #2nd floor + blocks.append(Block(SCREEN_WIDTH/4 + SCREEN_WIDTH/40, SCREEN_HEIGHT/2, length_between_vertical*3/5, SCREEN_HEIGHT/30,Color.RED.value, type="lava")) + blocks.append(Block(SCREEN_WIDTH/4 + SCREEN_WIDTH/40 + length_between_vertical*4/5, SCREEN_HEIGHT/2, length_between_vertical/5, SCREEN_HEIGHT/30,Color.RED.value, type="lava")) + #interfloor + blocks.append(Block(SCREEN_WIDTH/4 + SCREEN_WIDTH/40 + length_between_vertical*3/5, SCREEN_HEIGHT*5/8, length_between_vertical/5, SCREEN_HEIGHT/30,Color.BLUE.value)) + #3rd floor + blocks.append(Block(SCREEN_WIDTH/4 + SCREEN_WIDTH/40, SCREEN_HEIGHT*3/4, length_between_vertical*1/6, SCREEN_HEIGHT/30,Color.RED.value, type="lava")) + blocks.append(Block(SCREEN_WIDTH/4 + SCREEN_WIDTH/40 + length_between_vertical*2/6, SCREEN_HEIGHT*3/4, length_between_vertical*4/6, SCREEN_HEIGHT/30,Color.RED.value, type="lava")) + #interfloor + blocks.append(Block(SCREEN_WIDTH/4 + SCREEN_WIDTH/40 + length_between_vertical*1/6, SCREEN_HEIGHT*7/8, length_between_vertical/6, SCREEN_HEIGHT/30,Color.BLUE.value)) + + blocks.append(Block(SCREEN_WIDTH/4 + SCREEN_WIDTH/40 + length_between_vertical*3/5, SCREEN_HEIGHT*28/30, length_between_vertical/5, SCREEN_HEIGHT/60,Color.BLUE.value)) + + blocks.append(Block(SCREEN_WIDTH/4 + SCREEN_WIDTH/40 + length_between_vertical, SCREEN_HEIGHT*57/60, length_between_vertical/5, SCREEN_HEIGHT/60,Color.BLUE.value)) + + blocks.append(Block(SCREEN_WIDTH*3/4, SCREEN_HEIGHT*57/60, length_between_vertical/5, SCREEN_HEIGHT/60,Color.BLUE.value)) + + blocks.append(Block(SCREEN_WIDTH*9/10 - length_between_vertical/10, SCREEN_HEIGHT*47/60, length_between_vertical/10, SCREEN_HEIGHT/60,Color.BURGUNDY.value, type="jump")) + + blocks.append(Block(SCREEN_WIDTH*5/8 - length_between_vertical/10, SCREEN_HEIGHT*5/8, length_between_vertical/10, SCREEN_HEIGHT/60,Color.BURGUNDY.value, type="jump")) + + blocks.append(Block(SCREEN_WIDTH*9/10- length_between_vertical/10, SCREEN_HEIGHT*3/8, length_between_vertical/10, SCREEN_HEIGHT/60,Color.BURGUNDY.value, type="jump")) + + + + blocks.append(Block(SCREEN_WIDTH - (SCREEN_WIDTH/16 - SCREEN_WIDTH/80) - SCREEN_WIDTH/20, SCREEN_HEIGHT/10, SCREEN_WIDTH/20, SCREEN_HEIGHT/30, Color.YELLOW.value, type="win")) + return blocks \ No newline at end of file