├── LICENSE ├── Mario.png ├── Mario_gameplay.png ├── Next ├── BGObject.py ├── Camera.py ├── CoinDebris.py ├── Const.py ├── Core.py ├── DebugTable.py ├── Entity.py ├── Event.py ├── Fireball.py ├── Flag.py ├── Flower.py ├── GameUI.py ├── Goombas.py ├── Koopa.py ├── LoadingMenu.py ├── MainMenu.py ├── Map.py ├── MenuManager.py ├── Mushroom.py ├── Platform.py ├── PlatformDebris.py ├── Player.py ├── Sound.py ├── Text.py ├── Tube.py ├── fonts │ └── emulogic.ttf ├── images │ ├── Mario │ │ ├── mario.png │ │ ├── mario1.png │ │ ├── mario1_end.png │ │ ├── mario1_end1.png │ │ ├── mario1_jump.png │ │ ├── mario1_move0.png │ │ ├── mario1_move1.png │ │ ├── mario1_move2.png │ │ ├── mario1_st.png │ │ ├── mario2.png │ │ ├── mario2_end.png │ │ ├── mario2_end1.png │ │ ├── mario2_jump.png │ │ ├── mario2_move0.png │ │ ├── mario2_move1.png │ │ ├── mario2_move2.png │ │ ├── mario2_st.png │ │ ├── mario2s.bmp │ │ ├── mario2s_end.bmp │ │ ├── mario2s_end1.bmp │ │ ├── mario2s_jump.bmp │ │ ├── mario2s_move0.bmp │ │ ├── mario2s_move1.bmp │ │ ├── mario2s_move2.bmp │ │ ├── mario2s_st.bmp │ │ ├── mario_death.png │ │ ├── mario_end.png │ │ ├── mario_end1.png │ │ ├── mario_jump.png │ │ ├── mario_lvlup.png │ │ ├── mario_move0.png │ │ ├── mario_move1.png │ │ ├── mario_move2.png │ │ ├── mario_s0.bmp │ │ ├── mario_s0_death.bmp │ │ ├── mario_s0_end.bmp │ │ ├── mario_s0_end1.bmp │ │ ├── mario_s0_jump.bmp │ │ ├── mario_s0_move0.bmp │ │ ├── mario_s0_move1.bmp │ │ ├── mario_s0_move2.bmp │ │ ├── mario_s0_st.bmp │ │ ├── mario_s1.bmp │ │ ├── mario_s1_death.bmp │ │ ├── mario_s1_end.bmp │ │ ├── mario_s1_end1.bmp │ │ ├── mario_s1_jump.bmp │ │ ├── mario_s1_move0.bmp │ │ ├── mario_s1_move1.bmp │ │ ├── mario_s1_move2.bmp │ │ ├── mario_s1_st.bmp │ │ └── mario_st.png │ ├── block_debris0.png │ ├── block_debris1.png │ ├── coin_an0.png │ ├── coin_an1.png │ ├── coin_an2.png │ ├── coin_an3.png │ ├── fireball.png │ ├── firework0.png │ ├── firework1.png │ ├── firework2.png │ ├── flag.png │ ├── flag_pillar.png │ ├── flower0.png │ ├── flower1.png │ ├── flower2.png │ ├── flower3.png │ ├── goombas_0.png │ ├── goombas_1.png │ ├── goombas_dead.png │ ├── gr_cl_big.png │ ├── gr_cl_small.png │ ├── koopa_0.png │ ├── koopa_1.png │ ├── koopa_dead.png │ ├── mountain_tiles.png │ ├── mushroom.png │ ├── super_mario_bros.png │ └── tube.png ├── main.py ├── sounds │ ├── blockbreak.wav │ ├── blockhit.wav │ ├── coin.wav │ ├── death.wav │ ├── fireball.wav │ ├── gameover.wav │ ├── jump.wav │ ├── jumpbig.wav │ ├── kill_mob.wav │ ├── levelend.wav │ ├── mushroomappear.wav │ ├── mushroomeat.wav │ ├── overworld-fast.wav │ ├── overworld.wav │ ├── pipe.wav │ ├── scorering.wav │ └── shot.wav └── worlds │ └── 1-1 │ ├── W11.tmx │ ├── tiles.png │ └── tiles.tsx └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Winter091 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Mario.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Mario.png -------------------------------------------------------------------------------- /Mario_gameplay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Mario_gameplay.png -------------------------------------------------------------------------------- /Next/BGObject.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | 4 | class BGObject(object): 5 | def __init__(self, x, y, image): 6 | self.rect = pg.Rect(x, y, 32, 32) 7 | self.image = image 8 | self.type = 'BGObject' 9 | 10 | def render(self, core): 11 | core.screen.blit(self.image, core.get_map().get_camera().apply(self)) 12 | -------------------------------------------------------------------------------- /Next/Camera.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | from Const import * 4 | 5 | 6 | class Camera(object): 7 | """ 8 | 9 | I don't fully understand how it works. I just copied the whole class 10 | from the other project. Sorry. 11 | 12 | """ 13 | def __init__(self, width, height): 14 | self.rect = pg.Rect(0, 0, width, height) 15 | self.complex_camera(self.rect) 16 | 17 | def complex_camera(self, target_rect): 18 | x, y = target_rect.x, target_rect.y 19 | width, height = self.rect.width, self.rect.height 20 | x, y = (-x + WINDOW_W / 2 - target_rect.width / 2), (-y + WINDOW_H / 2 - target_rect.height) 21 | 22 | x = min(0, x) 23 | x = max(-(self.rect.width - WINDOW_W), x) 24 | y = WINDOW_H - self.rect.h 25 | 26 | return pg.Rect(x, y, width, height) 27 | 28 | def apply(self, target): 29 | return target.rect.x + self.rect.x, target.rect.y 30 | 31 | def update(self, target): 32 | self.rect = self.complex_camera(target) 33 | 34 | def reset(self): 35 | self.rect = pg.Rect(0, 0, self.rect.w, self.rect.h) 36 | -------------------------------------------------------------------------------- /Next/CoinDebris.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | 4 | class CoinDebris(object): 5 | """ 6 | 7 | Coin that appears when you hit the question block. 8 | 9 | """ 10 | def __init__(self, x_pos, y_pos): 11 | self.rect = pg.Rect(x_pos, y_pos, 16, 28) 12 | 13 | self.y_vel = -2 14 | self.y_offset = 0 15 | self.moving_up = True 16 | 17 | self.current_image = 0 18 | self.image_tick = 0 19 | self.images = [ 20 | pg.image.load('images/coin_an0.png').convert_alpha(), 21 | pg.image.load('images/coin_an1.png').convert_alpha(), 22 | pg.image.load('images/coin_an2.png').convert_alpha(), 23 | pg.image.load('images/coin_an3.png').convert_alpha() 24 | ] 25 | 26 | def update(self, core): 27 | self.image_tick += 1 28 | 29 | if self.image_tick % 15 == 0: 30 | self.current_image += 1 31 | 32 | if self.current_image == 4: 33 | self.current_image = 0 34 | self.image_tick = 0 35 | 36 | if self.moving_up: 37 | self.y_offset += self.y_vel 38 | self.rect.y += self.y_vel 39 | if self.y_offset < -50: 40 | self.moving_up = False 41 | self.y_vel = -self.y_vel 42 | else: 43 | self.y_offset += self.y_vel 44 | self.rect.y += self.y_vel 45 | if self.y_offset == 0: 46 | core.get_map().debris.remove(self) 47 | 48 | def render(self, core): 49 | core.screen.blit(self.images[self.current_image], core.get_map().get_camera().apply(self)) 50 | -------------------------------------------------------------------------------- /Next/Const.py: -------------------------------------------------------------------------------- 1 | WINDOW_W = 800 2 | WINDOW_H = 448 3 | FPS = 100 4 | 5 | # Player physics 6 | GRAVITY = 0.09 7 | SPEED_INCREASE_RATE = 0.038 8 | SPEED_DECREASE_RATE = 0.038 9 | JUMP_POWER = 4.3 10 | FALL_MULTIPLIER = 2.0 11 | LOW_JUMP_MULTIPLIER = 3.0 12 | MAX_MOVE_SPEED = 2.0 13 | MAX_FASTMOVE_SPEED = 3.0 14 | MAX_FALL_SPEED = 5.5 15 | 16 | -------------------------------------------------------------------------------- /Next/Core.py: -------------------------------------------------------------------------------- 1 | from os import environ 2 | 3 | import pygame as pg 4 | from pygame.locals import * 5 | 6 | from Const import * 7 | from Map import Map 8 | from MenuManager import MenuManager 9 | from Sound import Sound 10 | 11 | 12 | class Core(object): 13 | """ 14 | 15 | Main class. 16 | 17 | """ 18 | def __init__(self): 19 | environ['SDL_VIDEO_CENTERED'] = '1' 20 | pg.mixer.pre_init(44100, -16, 2, 1024) 21 | pg.init() 22 | pg.display.set_caption('Mario by S&D') 23 | pg.display.set_mode((WINDOW_W, WINDOW_H)) 24 | 25 | self.screen = pg.display.set_mode((WINDOW_W, WINDOW_H)) 26 | self.clock = pg.time.Clock() 27 | 28 | self.oWorld = Map('1-1') 29 | self.oSound = Sound() 30 | self.oMM = MenuManager(self) 31 | 32 | self.run = True 33 | self.keyR = False 34 | self.keyL = False 35 | self.keyU = False 36 | self.keyD = False 37 | self.keyShift = False 38 | 39 | def main_loop(self): 40 | while self.run: 41 | self.input() 42 | self.update() 43 | self.render() 44 | self.clock.tick(FPS) 45 | 46 | def input(self): 47 | if self.get_mm().currentGameState == 'Game': 48 | self.input_player() 49 | else: 50 | self.input_menu() 51 | 52 | def input_player(self): 53 | for e in pg.event.get(): 54 | 55 | if e.type == pg.QUIT: 56 | self.run = False 57 | 58 | elif e.type == KEYDOWN: 59 | if e.key == K_RIGHT: 60 | self.keyR = True 61 | elif e.key == K_LEFT: 62 | self.keyL = True 63 | elif e.key == K_DOWN: 64 | self.keyD = True 65 | elif e.key == K_UP: 66 | self.keyU = True 67 | elif e.key == K_LSHIFT: 68 | self.keyShift = True 69 | 70 | elif e.type == KEYUP: 71 | if e.key == K_RIGHT: 72 | self.keyR = False 73 | elif e.key == K_LEFT: 74 | self.keyL = False 75 | elif e.key == K_DOWN: 76 | self.keyD = False 77 | elif e.key == K_UP: 78 | self.keyU = False 79 | elif e.key == K_LSHIFT: 80 | self.keyShift = False 81 | 82 | def input_menu(self): 83 | for e in pg.event.get(): 84 | if e.type == pg.QUIT: 85 | self.run = False 86 | 87 | elif e.type == KEYDOWN: 88 | if e.key == K_RETURN: 89 | self.get_mm().start_loading() 90 | 91 | def update(self): 92 | self.get_mm().update(self) 93 | 94 | def render(self): 95 | self.get_mm().render(self) 96 | 97 | def get_map(self): 98 | return self.oWorld 99 | 100 | def get_mm(self): 101 | return self.oMM 102 | 103 | def get_sound(self): 104 | return self.oSound 105 | -------------------------------------------------------------------------------- /Next/DebugTable.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | 4 | class DebugTable(object): 5 | """ 6 | 7 | I don't use it anymore. This class helped me a lot on the 8 | develop days because it displayed some variables in real time. 9 | 10 | """ 11 | def __init__(self): 12 | self.font = pg.font.SysFont('Consolas', 12) 13 | self.darkArea = pg.Surface((200, 100)).convert_alpha() 14 | self.darkArea.fill((0, 0, 0, 200)) 15 | self.text = [] 16 | self.rect = 0 17 | self.offsetX = 12 18 | self.x = 5 19 | self.mode = 2 20 | 21 | def update_text(self, core): 22 | if self.mode == 2: 23 | self.text = [ 24 | 'FPS: ' + str(int(core.clock.get_fps())), 25 | 'Rect: ' + str(core.get_map().get_player().rect.x) + ' ' + str(core.get_map().get_player().rect.y) + ' h: ' + str(core.get_map().get_player().rect.h), 26 | 'g: ' + str(core.get_map().get_player().on_ground) + ' LVL: ' + str(core.get_map().get_player().powerLVL) + ' inv: ' + str(core.get_map().get_player().unkillable), 27 | 'Spr: ' + str(core.get_map().get_player().spriteTick) + ' J lock: ' + str(core.get_map().get_player().already_jumped), 28 | 'Up : ' + str(core.get_map().get_player().inLevelUpAnimation) + ' time: ' + str(core.get_map().get_player().inLevelUpAnimationTime), 29 | 'Down: ' + str(core.get_map().get_player().inLevelDownAnimation) + ' time: ' + str(core.get_map().get_player().inLevelDownAnimationTime), 30 | 'Mobs: ' + str(len(core.get_map().get_mobs())) + ' FB: ' + str(len(core.get_map().projectiles)) + ' Debris: ' + str(len(core.get_map().debris)) 31 | ] 32 | 33 | def render(self, core): 34 | self.x = 105 35 | if self.mode == 2: 36 | core.screen.blit(self.darkArea, (0, 100)) 37 | for string in self.text: 38 | self.rect = self.font.render(string, True, (255, 255, 255)) 39 | core.screen.blit(self.rect, (5, self.x)) 40 | self.x += self.offsetX 41 | -------------------------------------------------------------------------------- /Next/Entity.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | from Const import * 3 | 4 | 5 | class Entity(object): 6 | """ 7 | 8 | Parent class for mobs. 9 | 10 | """ 11 | def __init__(self): 12 | 13 | self.state = 0 14 | self.x_vel = 0 15 | self.y_vel = 0 16 | 17 | self.move_direction = True 18 | self.on_ground = False 19 | self.collision = True 20 | 21 | self.image = None 22 | self.rect = None 23 | 24 | def update_x_pos(self, blocks): 25 | self.rect.x += self.x_vel 26 | 27 | for block in blocks: 28 | if block != 0 and block.type != 'BGObject': 29 | if pg.Rect.colliderect(self.rect, block.rect): 30 | if self.x_vel > 0: 31 | self.rect.right = block.rect.left 32 | self.x_vel = - self.x_vel 33 | elif self.x_vel < 0: 34 | self.rect.left = block.rect.right 35 | self.x_vel = - self.x_vel 36 | 37 | def update_y_pos(self, blocks): 38 | self.rect.y += self.y_vel * FALL_MULTIPLIER 39 | 40 | self.on_ground = False 41 | for block in blocks: 42 | if block != 0 and block.type != 'BGObject': 43 | if pg.Rect.colliderect(self.rect, block.rect): 44 | if self.y_vel > 0: 45 | self.on_ground = True 46 | self.rect.bottom = block.rect.top 47 | self.y_vel = 0 48 | 49 | def check_map_borders(self, core): 50 | if self.rect.y >= 448: 51 | self.die(core, True, False) 52 | if self.rect.x <= 1 and self.x_vel < 0: 53 | self.x_vel = - self.x_vel 54 | 55 | def die(self, core, instantly, crushed): 56 | pass 57 | 58 | def render(self, core): 59 | pass 60 | -------------------------------------------------------------------------------- /Next/Event.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | from Const import * 4 | 5 | 6 | class Event(object): 7 | def __init__(self): 8 | 9 | # 0 = Kill/Game Over 10 | # 1 = Win (using flag) 11 | self.type = 0 12 | 13 | self.delay = 0 14 | self.time = 0 15 | self.x_vel = 0 16 | self.y_vel = 0 17 | self.game_over = False 18 | 19 | self.player_in_castle = False 20 | self.tick = 0 21 | self.score_tick = 0 22 | 23 | def reset(self): 24 | self.type = 0 25 | 26 | self.delay = 0 27 | self.time = 0 28 | self.x_vel = 0 29 | self.y_vel = 0 30 | self.game_over = False 31 | 32 | self.player_in_castle = False 33 | self.tick = 0 34 | self.score_tick = 0 35 | 36 | def start_kill(self, core, game_over): 37 | """ 38 | 39 | Player gets killed. 40 | 41 | """ 42 | self.type = 0 43 | self.delay = 4000 44 | self.y_vel = -4 45 | self.time = pg.time.get_ticks() 46 | self.game_over = game_over 47 | 48 | core.get_sound().stop('overworld') 49 | core.get_sound().stop('overworld_fast') 50 | core.get_sound().play('death', 0, 0.5) 51 | 52 | # Sets "dead" sprite 53 | core.get_map().get_player().set_image(len(core.get_map().get_player().sprites)) 54 | 55 | def start_win(self, core): 56 | """ 57 | 58 | player touches the flag. 59 | 60 | """ 61 | self.type = 1 62 | self.delay = 2000 63 | self.time = 0 64 | 65 | core.get_sound().stop('overworld') 66 | core.get_sound().stop('overworld_fast') 67 | core.get_sound().play('level_end', 0, 0.5) 68 | 69 | core.get_map().get_player().set_image(5) 70 | core.get_map().get_player().x_vel = 1 71 | core.get_map().get_player().rect.x += 10 72 | 73 | # Adding score depends on the map's time left. 74 | if core.get_map().time >= 300: 75 | core.get_map().get_player().add_score(5000) 76 | core.get_map().spawn_score_text(core.get_map().get_player().rect.x + 16, core.get_map().get_player().rect.y, score=5000) 77 | elif 200 <= core.get_map().time < 300: 78 | core.get_map().get_player().add_score(2000) 79 | core.get_map().spawn_score_text(core.get_map().get_player().rect.x + 16, core.get_map().get_player().rect.y, score=2000) 80 | else: 81 | core.get_map().get_player().add_score(1000) 82 | core.get_map().spawn_score_text(core.get_map().get_player().rect.x + 16, core.get_map().get_player().rect.y, score=1000) 83 | 84 | def update(self, core): 85 | 86 | # Death 87 | if self.type == 0: 88 | self.y_vel += GRAVITY * FALL_MULTIPLIER if self.y_vel < 6 else 0 89 | core.get_map().get_player().rect.y += self.y_vel 90 | 91 | if pg.time.get_ticks() > self.time + self.delay: 92 | if not self.game_over: 93 | core.get_map().get_player().reset_move() 94 | core.get_map().get_player().reset_jump() 95 | core.get_map().reset(False) 96 | core.get_sound().play('overworld', 9999999, 0.5) 97 | else: 98 | core.get_mm().currentGameState = 'Loading' 99 | core.get_mm().oLoadingMenu.set_text_and_type('GAME OVER', False) 100 | core.get_mm().oLoadingMenu.update_time() 101 | core.get_sound().play('game_over', 0, 0.5) 102 | 103 | # Flag win 104 | elif self.type == 1: 105 | 106 | if not self.player_in_castle: 107 | 108 | if not core.get_map().flag.flag_omitted: 109 | core.get_map().get_player().set_image(5) 110 | core.get_map().flag.move_flag_down() 111 | core.get_map().get_player().flag_animation_move(core, False) 112 | 113 | else: 114 | self.tick += 1 115 | if self.tick == 1: 116 | core.get_map().get_player().direction = False 117 | core.get_map().get_player().set_image(6) 118 | core.get_map().get_player().rect.x += 20 119 | elif self.tick >= 30: 120 | core.get_map().get_player().flag_animation_move(core, True) 121 | core.get_map().get_player().update_image(core) 122 | 123 | else: 124 | if core.get_map().time > 0: 125 | self.score_tick += 1 126 | if self.score_tick % 10 == 0: 127 | core.get_sound().play('scorering', 0, 0.5) 128 | 129 | core.get_map().time -= 1 130 | core.get_map().get_player().add_score(50) 131 | 132 | else: 133 | if self.time == 0: 134 | self.time = pg.time.get_ticks() 135 | 136 | elif pg.time.get_ticks() >= self.time + self.delay: 137 | core.get_mm().currentGameState = 'Loading' 138 | core.get_mm().oLoadingMenu.set_text_and_type('BY S&D :)', False) 139 | core.get_mm().oLoadingMenu.update_time() 140 | core.get_sound().play('game_over', 0, 0.5) 141 | -------------------------------------------------------------------------------- /Next/Fireball.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | from Const import * 4 | 5 | 6 | class Fireball(object): 7 | def __init__(self, x_pos, y_pos, move_direction: bool): 8 | super().__init__() 9 | 10 | self.rect = pg.Rect(x_pos, y_pos, 16, 16) 11 | self.state = 0 12 | self.direction = move_direction 13 | self.x_vel = 5 if move_direction else -5 14 | self.y_vel = 0 15 | 16 | self.current_image = 0 17 | self.image_tick = 0 18 | self.images = [pg.image.load('images/fireball.png').convert_alpha()] 19 | self.images.append(pg.transform.flip(self.images[0], 0, 90)) 20 | self.images.append(pg.transform.flip(self.images[0], 90, 90)) 21 | self.images.append(pg.transform.flip(self.images[0], 90, 0)) 22 | self.images.append(pg.image.load('images/firework0.png').convert_alpha()) 23 | self.images.append(pg.image.load('images/firework1.png').convert_alpha()) 24 | self.images.append(pg.image.load('images/firework2.png').convert_alpha()) 25 | 26 | def update_image(self, core): 27 | self.image_tick += 1 28 | 29 | if self.state == 0: 30 | if self.image_tick % 15 == 0: 31 | self.current_image += 1 32 | if self.current_image > 3: 33 | self.current_image = 0 34 | self.image_tick = 0 35 | 36 | elif self.state == -1: 37 | if self.image_tick % 10 == 0: 38 | self.current_image += 1 39 | if self.current_image == 7: 40 | core.get_map().remove_whizbang(self) 41 | 42 | def start_boom(self): 43 | self.x_vel = 0 44 | self.y_vel = 0 45 | self.current_image = 4 46 | self.image_tick = 0 47 | self.state = -1 48 | 49 | def update_x_pos(self, blocks): 50 | self.rect.x += self.x_vel 51 | 52 | for block in blocks: 53 | if block != 0 and block.type != 'BGObject': 54 | if pg.Rect.colliderect(self.rect, block.rect): 55 | 56 | # Fireball blows up only when collides on x-axis 57 | self.start_boom() 58 | 59 | def update_y_pos(self, blocks): 60 | self.rect.y += self.y_vel 61 | for block in blocks: 62 | if block != 0 and block.type != 'BGObject': 63 | if pg.Rect.colliderect(self.rect, block.rect): 64 | self.rect.bottom = block.rect.top 65 | self.y_vel = -3 66 | 67 | def check_map_borders(self, core): 68 | if self.rect.x <= 0: 69 | core.get_map().remove_whizbang(self) 70 | elif self.rect.x >= 6768: 71 | core.get_map().remove_whizbang(self) 72 | elif self.rect.y > 448: 73 | core.get_map().remove_whizbang(self) 74 | 75 | def move(self, core): 76 | self.y_vel += GRAVITY 77 | 78 | blocks = core.get_map().get_blocks_for_collision(self.rect.x // 32, self.rect.y // 32) 79 | self.update_y_pos(blocks) 80 | self.update_x_pos(blocks) 81 | 82 | self.check_map_borders(core) 83 | 84 | def check_collision_with_mobs(self, core): 85 | for mob in core.get_map().get_mobs(): 86 | if self.rect.colliderect(mob.rect): 87 | if mob.collision: 88 | mob.die(core, instantly=False, crushed=False) 89 | self.start_boom() 90 | 91 | def update(self, core): 92 | if self.state == 0: 93 | self.update_image(core) 94 | self.move(core) 95 | self.check_collision_with_mobs(core) 96 | elif self.state == -1: 97 | self.update_image(core) 98 | 99 | def render(self, core): 100 | core.screen.blit(self.images[self.current_image], core.get_map().get_camera().apply(self)) 101 | -------------------------------------------------------------------------------- /Next/Flag.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | 4 | class Flag(object): 5 | def __init__(self, x_pos, y_pos): 6 | self.rect = None 7 | 8 | self.flag_offset = 0 9 | self.flag_omitted = False 10 | 11 | # Flag object consists of 2 parts: 12 | 13 | self.pillar_image = pg.image.load('images/flag_pillar.png').convert_alpha() 14 | self.pillar_rect = pg.Rect(x_pos + 8, y_pos, 16, 304) 15 | 16 | self.flag_image = pg.image.load('images/flag.png').convert_alpha() 17 | self.flag_rect = pg.Rect(x_pos - 18, y_pos + 16, 32, 32) 18 | 19 | def move_flag_down(self): 20 | self.flag_offset += 3 21 | self.flag_rect.y += 3 22 | 23 | if self.flag_offset >= 255: 24 | self.flag_omitted = True 25 | 26 | def render(self, core): 27 | self.rect = self.pillar_rect 28 | core.screen.blit(self.pillar_image, core.get_map().get_camera().apply(self)) 29 | 30 | self.rect = self.flag_rect 31 | core.screen.blit(self.flag_image, core.get_map().get_camera().apply(self)) -------------------------------------------------------------------------------- /Next/Flower.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | from Entity import Entity 4 | 5 | 6 | class Flower(Entity): 7 | def __init__(self, x_pos, y_pos): 8 | super().__init__() 9 | 10 | self.rect = pg.Rect(x_pos, y_pos, 32, 32) 11 | self.spawned = False 12 | self.spawn_y_offset = 0 13 | 14 | self.current_image = 0 15 | self.image_tick = 0 16 | self.images = ( 17 | pg.image.load('images/flower0.png').convert_alpha(), 18 | pg.image.load('images/flower1.png').convert_alpha(), 19 | pg.image.load('images/flower2.png').convert_alpha(), 20 | pg.image.load('images/flower3.png').convert_alpha() 21 | ) 22 | 23 | def check_collision_with_player(self, core): 24 | if self.rect.colliderect(core.get_map().get_player().rect): 25 | core.get_map().get_player().set_powerlvl(3, core) 26 | core.get_map().get_mobs().remove(self) 27 | 28 | def update_image(self): 29 | self.image_tick += 1 30 | 31 | if self.image_tick == 60: 32 | self.image_tick = 0 33 | self.current_image = 0 34 | 35 | elif self.image_tick % 15 == 0: 36 | self.current_image += 1 37 | 38 | def spawn_animation(self): 39 | self.spawn_y_offset -= 1 40 | self.rect.y -= 1 41 | 42 | if self.spawn_y_offset == -32: 43 | self.spawned = True 44 | 45 | def update(self, core): 46 | if self.spawned: 47 | self.update_image() 48 | else: 49 | self.spawn_animation() 50 | 51 | def render(self, core): 52 | core.screen.blit(self.images[self.current_image], core.get_map().get_camera().apply(self)) 53 | -------------------------------------------------------------------------------- /Next/GameUI.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | 4 | class GameUI(object): 5 | def __init__(self): 6 | self.font = pg.font.Font('fonts/emulogic.ttf', 20) 7 | self.text = 'SCORE COINS WORLD TIME LIVES' 8 | 9 | def render(self, core): 10 | x = 10 11 | for word in self.text.split(' '): 12 | rect = self.font.render(word, False, (255, 255, 255)) 13 | core.screen.blit(rect, (x, 0)) 14 | x += 168 15 | 16 | text = self.font.render(str(core.get_map().get_player().score), False, (255, 255, 255)) 17 | rect = text.get_rect(center=(60, 35)) 18 | core.screen.blit(text, rect) 19 | 20 | text = self.font.render(str(core.get_map().get_player().coins), False, (255, 255, 255)) 21 | rect = text.get_rect(center=(230, 35)) 22 | core.screen.blit(text, rect) 23 | 24 | text = self.font.render(core.get_map().get_name(), False, (255, 255, 255)) 25 | rect = text.get_rect(center=(395, 35)) 26 | core.screen.blit(text, rect) 27 | 28 | text = self.font.render(str(core.get_map().time), False, (255, 255, 255)) 29 | rect = text.get_rect(center=(557, 35)) 30 | core.screen.blit(text, rect) 31 | 32 | text = self.font.render(str(core.get_map().get_player().numOfLives), False, (255, 255, 255)) 33 | rect = text.get_rect(center=(730, 35)) 34 | core.screen.blit(text, rect) 35 | -------------------------------------------------------------------------------- /Next/Goombas.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | from Entity import Entity 4 | from Const import * 5 | 6 | 7 | class Goombas(Entity): 8 | def __init__(self, x_pos, y_pos, move_direction): 9 | super().__init__() 10 | self.rect = pg.Rect(x_pos, y_pos, 32, 32) 11 | 12 | if move_direction: 13 | self.x_vel = 1 14 | else: 15 | self.x_vel = -1 16 | 17 | self.crushed = False 18 | 19 | self.current_image = 0 20 | self.image_tick = 0 21 | self.images = [ 22 | pg.image.load('images/goombas_0.png').convert_alpha(), 23 | pg.image.load('images/goombas_1.png').convert_alpha(), 24 | pg.image.load('images/goombas_dead.png').convert_alpha() 25 | ] 26 | self.images.append(pg.transform.flip(self.images[0], 0, 180)) 27 | 28 | def die(self, core, instantly, crushed): 29 | if not instantly: 30 | core.get_map().get_player().add_score(core.get_map().score_for_killing_mob) 31 | core.get_map().spawn_score_text(self.rect.x + 16, self.rect.y) 32 | 33 | if crushed: 34 | self.crushed = True 35 | self.image_tick = 0 36 | self.current_image = 2 37 | self.state = -1 38 | core.get_sound().play('kill_mob', 0, 0.5) 39 | self.collision = False 40 | 41 | else: 42 | self.y_vel = -4 43 | self.current_image = 3 44 | core.get_sound().play('shot', 0, 0.5) 45 | self.state = -1 46 | self.collision = False 47 | 48 | else: 49 | core.get_map().get_mobs().remove(self) 50 | 51 | def check_collision_with_player(self, core): 52 | if self.collision: 53 | if self.rect.colliderect(core.get_map().get_player().rect): 54 | if self.state != -1: 55 | if core.get_map().get_player().y_vel > 0: 56 | self.die(core, instantly=False, crushed=True) 57 | core.get_map().get_player().reset_jump() 58 | core.get_map().get_player().jump_on_mob() 59 | else: 60 | if not core.get_map().get_player().unkillable: 61 | core.get_map().get_player().set_powerlvl(0, core) 62 | 63 | def update_image(self): 64 | self.image_tick += 1 65 | if self.image_tick == 14: 66 | self.current_image = 1 67 | elif self.image_tick == 28: 68 | self.current_image = 0 69 | self.image_tick = 0 70 | 71 | def update(self, core): 72 | if self.state == 0: 73 | self.update_image() 74 | 75 | if not self.on_ground: 76 | self.y_vel += GRAVITY 77 | 78 | blocks = core.get_map().get_blocks_for_collision(int(self.rect.x // 32), int(self.rect.y // 32)) 79 | self.update_x_pos(blocks) 80 | self.update_y_pos(blocks) 81 | 82 | self.check_map_borders(core) 83 | 84 | elif self.state == -1: 85 | if self.crushed: 86 | self.image_tick += 1 87 | if self.image_tick == 50: 88 | core.get_map().get_mobs().remove(self) 89 | else: 90 | self.y_vel += GRAVITY 91 | self.rect.y += self.y_vel 92 | self.check_map_borders(core) 93 | 94 | def render(self, core): 95 | core.screen.blit(self.images[self.current_image], core.get_map().get_camera().apply(self)) 96 | -------------------------------------------------------------------------------- /Next/Koopa.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | from Entity import Entity 4 | from Const import * 5 | 6 | 7 | class Koopa(Entity): 8 | def __init__(self, x_pos, y_pos, move_direction): 9 | super().__init__() 10 | self.rect = pg.Rect(x_pos, y_pos, 32, 46) 11 | 12 | self.move_direction = move_direction 13 | 14 | if move_direction: 15 | self.x_vel = 1 16 | else: 17 | self.x_vel = -1 18 | 19 | self.current_image = 0 20 | self.image_tick = 0 21 | self.images = [ 22 | pg.image.load('images/koopa_0.png').convert_alpha(), 23 | pg.image.load('images/koopa_1.png').convert_alpha(), 24 | pg.image.load('images/koopa_dead.png').convert_alpha() 25 | ] 26 | self.images.append(pg.transform.flip(self.images[0], 180, 0)) 27 | self.images.append(pg.transform.flip(self.images[1], 180, 0)) 28 | self.images.append(pg.transform.flip(self.images[2], 0, 180)) 29 | 30 | """ 31 | States: 32 | 0 - Just walking around 33 | 1 - Hidden 34 | 2 - Hidden and fast moving 35 | -1 - Dead 36 | """ 37 | 38 | def check_collision_with_player(self, core): 39 | if self.collision: 40 | if self.rect.colliderect(core.get_map().get_player().rect): 41 | if self.state != -1: 42 | if core.get_map().get_player().y_vel > 0: 43 | self.change_state(core) 44 | core.get_sound().play('kill_mob', 0, 0.5) 45 | core.get_map().get_player().reset_jump() 46 | core.get_map().get_player().jump_on_mob() 47 | else: 48 | if not core.get_map().get_player().unkillable: 49 | core.get_map().get_player().set_powerlvl(0, core) 50 | 51 | def check_collision_with_mobs(self, core): 52 | for mob in core.get_map().get_mobs(): 53 | if mob is not self: 54 | if self.rect.colliderect(mob.rect): 55 | if mob.collision: 56 | mob.die(core, instantly=False, crushed=False) 57 | 58 | def die(self, core, instantly, crushed): 59 | if not instantly: 60 | core.get_map().get_player().add_score(core.get_map().score_for_killing_mob) 61 | core.get_map().spawn_score_text(self.rect.x + 16, self.rect.y) 62 | self.state = -1 63 | self.y_vel = -4 64 | self.current_image = 5 65 | else: 66 | core.get_map().get_mobs().remove(self) 67 | 68 | def change_state(self, core): 69 | self.state += 1 70 | self.current_image = 2 71 | 72 | # 0 to 1 state 73 | if self.rect.h == 46: 74 | self.x_vel = 0 75 | self.rect.h = 32 76 | self.rect.y += 14 77 | core.get_map().get_player().add_score(100) 78 | core.get_map().spawn_score_text(self.rect.x + 16, self.rect.y, score=100) 79 | 80 | # 1 to 2 81 | elif self.state == 2: 82 | core.get_map().get_player().add_score(100) 83 | core.get_map().spawn_score_text(self.rect.x + 16, self.rect.y, score=100) 84 | 85 | if core.get_map().get_player().rect.x - self.rect.x <= 0: 86 | self.x_vel = 6 87 | else: 88 | self.x_vel = -6 89 | 90 | # 2 to 3 91 | elif self.state == 3: 92 | self.die(core, instantly=False, crushed=False) 93 | 94 | def update_image(self): 95 | self.image_tick += 1 96 | 97 | if self.x_vel > 0: 98 | self.move_direction = True 99 | else: 100 | self.move_direction = False 101 | 102 | if self.image_tick == 35: 103 | if self.move_direction: 104 | self.current_image = 4 105 | else: 106 | self.current_image = 1 107 | elif self.image_tick == 70: 108 | if self.move_direction: 109 | self.current_image = 3 110 | else: 111 | self.current_image = 0 112 | self.image_tick = 0 113 | 114 | def update(self, core): 115 | if self.state == 0: 116 | self.update_image() 117 | 118 | if not self.on_ground: 119 | self.y_vel += GRAVITY 120 | 121 | blocks = core.get_map().get_blocks_for_collision(self.rect.x // 32, (self.rect.y - 14) // 32) 122 | self.update_x_pos(blocks) 123 | self.update_y_pos(blocks) 124 | 125 | self.check_map_borders(core) 126 | 127 | elif self.state == 1: 128 | blocks = core.get_map().get_blocks_for_collision(self.rect.x // 32, self.rect.y // 32) 129 | self.update_x_pos(blocks) 130 | self.update_y_pos(blocks) 131 | 132 | self.check_map_borders(core) 133 | 134 | elif self.state == 2: 135 | if not self.on_ground: 136 | self.y_vel += GRAVITY 137 | 138 | blocks = core.get_map().get_blocks_for_collision(self.rect.x // 32, self.rect.y // 32) 139 | self.update_x_pos(blocks) 140 | self.update_y_pos(blocks) 141 | 142 | self.check_map_borders(core) 143 | self.check_collision_with_mobs(core) 144 | 145 | elif self.state == -1: 146 | self.rect.y += self.y_vel 147 | self.y_vel += GRAVITY 148 | 149 | self.check_map_borders(core) 150 | 151 | def render(self, core): 152 | core.screen.blit(self.images[self.current_image], core.get_map().get_camera().apply(self)) 153 | -------------------------------------------------------------------------------- /Next/LoadingMenu.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | from Const import * 4 | from Text import Text 5 | 6 | 7 | class LoadingMenu(object): 8 | def __init__(self, core): 9 | self.iTime = pg.time.get_ticks() 10 | self.loadingType = True 11 | self.bg = pg.Surface((WINDOW_W, WINDOW_H)) 12 | self.text = Text('WORLD ' + core.oWorld.get_name(), 32, (WINDOW_W / 2, WINDOW_H / 2)) 13 | 14 | def update(self, core): 15 | if pg.time.get_ticks() >= self.iTime + (5250 if not self.loadingType else 2500): 16 | if self.loadingType: 17 | core.oMM.currentGameState = 'Game' 18 | core.get_sound().play('overworld', 999999, 0.5) 19 | core.get_map().in_event = False 20 | else: 21 | core.oMM.currentGameState = 'MainMenu' 22 | self.set_text_and_type('WORLD ' + core.oWorld.get_name(), True) 23 | core.get_map().reset(True) 24 | 25 | def set_text_and_type(self, text, type): 26 | self.text = Text(text, 32, (WINDOW_W / 2, WINDOW_H / 2)) 27 | self.loadingType = type 28 | 29 | def render(self, core): 30 | core.screen.blit(self.bg, (0, 0)) 31 | self.text.render(core) 32 | 33 | def update_time(self): 34 | self.iTime = pg.time.get_ticks() 35 | -------------------------------------------------------------------------------- /Next/MainMenu.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | from Const import * 4 | from Text import Text 5 | 6 | 7 | class MainMenu(object): 8 | def __init__(self): 9 | self.mainImage = pg.image.load(r'images\super_mario_bros.png').convert_alpha() 10 | 11 | self.toStartText = Text('Press ENTER to start', 16, (WINDOW_W - WINDOW_W * 0.72, WINDOW_H - WINDOW_H * 0.3)) 12 | 13 | def render(self, core): 14 | core.screen.blit(self.mainImage, (50, 50)) 15 | self.toStartText.render(core) 16 | -------------------------------------------------------------------------------- /Next/Map.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | from pytmx.util_pygame import load_pygame 3 | 4 | from GameUI import GameUI 5 | from BGObject import BGObject 6 | from Camera import Camera 7 | from Event import Event 8 | from Flag import Flag 9 | from Const import * 10 | from Platform import Platform 11 | from Player import Player 12 | from Goombas import Goombas 13 | from Mushroom import Mushroom 14 | from Flower import Flower 15 | from Koopa import Koopa 16 | from Tube import Tube 17 | from PlatformDebris import PlatformDebris 18 | from CoinDebris import CoinDebris 19 | from Fireball import Fireball 20 | from Text import Text 21 | 22 | 23 | class Map(object): 24 | """ 25 | 26 | This class contains every map object: tiles, mobs and player. Also, 27 | there are camera, event and UI. 28 | 29 | """ 30 | 31 | def __init__(self, world_num): 32 | self.obj = [] 33 | self.obj_bg = [] 34 | self.tubes = [] 35 | self.debris = [] 36 | self.mobs = [] 37 | self.projectiles = [] 38 | self.text_objects = [] 39 | self.map = 0 40 | self.flag = None 41 | 42 | self.mapSize = (0, 0) 43 | self.sky = 0 44 | 45 | self.textures = {} 46 | self.worldNum = world_num 47 | self.loadWorld_11() 48 | 49 | self.is_mob_spawned = [False, False] 50 | self.score_for_killing_mob = 100 51 | self.score_time = 0 52 | 53 | self.in_event = False 54 | self.tick = 0 55 | self.time = 400 56 | 57 | self.oPlayer = Player(x_pos=128, y_pos=351) 58 | self.oCamera = Camera(self.mapSize[0] * 32, 14) 59 | self.oEvent = Event() 60 | self.oGameUI = GameUI() 61 | 62 | def loadWorld_11(self): 63 | tmx_data = load_pygame("worlds/1-1/W11.tmx") 64 | self.mapSize = (tmx_data.width, tmx_data.height) 65 | 66 | self.sky = pg.Surface((WINDOW_W, WINDOW_H)) 67 | self.sky.fill((pg.Color('#5c94fc'))) 68 | 69 | # 2D List 70 | self.map = [[0] * tmx_data.height for i in range(tmx_data.width)] 71 | 72 | layer_num = 0 73 | for layer in tmx_data.visible_layers: 74 | for y in range(tmx_data.height): 75 | for x in range(tmx_data.width): 76 | 77 | # Getting pygame surface 78 | image = tmx_data.get_tile_image(x, y, layer_num) 79 | 80 | # It's none if there are no tile in that place 81 | if image is not None: 82 | tileID = tmx_data.get_tile_gid(x, y, layer_num) 83 | 84 | if layer.name == 'Foreground': 85 | 86 | # 22 ID is a question block, so in taht case we shoud load all it's images 87 | if tileID == 22: 88 | image = ( 89 | image, # 1 90 | tmx_data.get_tile_image(0, 15, layer_num), # 2 91 | tmx_data.get_tile_image(1, 15, layer_num), # 3 92 | tmx_data.get_tile_image(2, 15, layer_num) # activated 93 | ) 94 | 95 | # Map class has 1)"map" list, which is used in collision system because we can 96 | # easily get block by x and y coordinate 2)"obj", "obj_bg" and simular arrays - 97 | # they are used in rendering because you don't need to cycle through every 98 | # (x, y) pair. Here we are adding the same platform object in 2 different arrays. 99 | self.map[x][y] = Platform(x * tmx_data.tileheight, y * tmx_data.tilewidth, image, tileID) 100 | self.obj.append(self.map[x][y]) 101 | 102 | elif layer.name == 'Background': 103 | self.map[x][y] = BGObject(x * tmx_data.tileheight, y * tmx_data.tilewidth, image) 104 | self.obj_bg.append(self.map[x][y]) 105 | layer_num += 1 106 | 107 | # Tubes 108 | self.spawn_tube(28, 10) 109 | self.spawn_tube(37, 9) 110 | self.spawn_tube(46, 8) 111 | self.spawn_tube(55, 8) 112 | self.spawn_tube(163, 10) 113 | self.spawn_tube(179, 10) 114 | 115 | # Mobs 116 | self.mobs.append(Goombas(736, 352, False)) 117 | self.mobs.append(Goombas(1295, 352, True)) 118 | self.mobs.append(Goombas(1632, 352, False)) 119 | self.mobs.append(Goombas(1672, 352, False)) 120 | self.mobs.append(Goombas(5570, 352, False)) 121 | self.mobs.append(Goombas(5620, 352, False)) 122 | 123 | self.map[21][8].bonus = 'mushroom' 124 | self.map[78][8].bonus = 'mushroom' 125 | self.map[109][4].bonus = 'mushroom' 126 | 127 | self.flag = Flag(6336, 48) 128 | 129 | def reset(self, reset_all): 130 | self.obj = [] 131 | self.obj_bg = [] 132 | self.tubes = [] 133 | self.debris = [] 134 | self.mobs = [] 135 | self.is_mob_spawned = [False, False] 136 | 137 | self.in_event = False 138 | self.flag = None 139 | self.sky = None 140 | self.map = None 141 | 142 | self.tick = 0 143 | self.time = 400 144 | 145 | self.mapSize = (0, 0) 146 | self.textures = {} 147 | self.loadWorld_11() 148 | 149 | self.get_event().reset() 150 | self.get_player().reset(reset_all) 151 | self.get_camera().reset() 152 | 153 | def get_name(self): 154 | if self.worldNum == '1-1': 155 | return '1-1' 156 | 157 | def get_player(self): 158 | return self.oPlayer 159 | 160 | def get_camera(self): 161 | return self.oCamera 162 | 163 | def get_event(self): 164 | return self.oEvent 165 | 166 | def get_ui(self): 167 | return self.oGameUI 168 | 169 | def get_blocks_for_collision(self, x, y): 170 | """ 171 | 172 | Returns tiles around the entity 173 | 174 | """ 175 | return ( 176 | self.map[x][y - 1], 177 | self.map[x][y + 1], 178 | self.map[x][y], 179 | self.map[x - 1][y], 180 | self.map[x + 1][y], 181 | self.map[x + 2][y], 182 | self.map[x + 1][y - 1], 183 | self.map[x + 1][y + 1], 184 | self.map[x][y + 2], 185 | self.map[x + 1][y + 2], 186 | self.map[x - 1][y + 1], 187 | self.map[x + 2][y + 1], 188 | self.map[x][y + 3], 189 | self.map[x + 1][y + 3] 190 | ) 191 | 192 | def get_blocks_below(self, x, y): 193 | """ 194 | 195 | Returns 2 blocks below entity to check its on_ground parameter 196 | 197 | """ 198 | return ( 199 | self.map[x][y + 1], 200 | self.map[x + 1][y + 1] 201 | ) 202 | 203 | def get_mobs(self): 204 | return self.mobs 205 | 206 | def spawn_tube(self, x_coord, y_coord): 207 | self.tubes.append(Tube(x_coord, y_coord)) 208 | 209 | # Adding tube's collision just by spawning tiles inside the tube. 210 | # They will not render because we are adding them to "collision" list. 211 | for y in range(y_coord, 12): # 12 because it's ground level. 212 | for x in range(x_coord, x_coord + 2): 213 | self.map[x][y] = Platform(x * 32, y * 32, image=None, type_id=0) 214 | 215 | def spawn_mushroom(self, x, y): 216 | self.get_mobs().append(Mushroom(x, y, True)) 217 | 218 | def spawn_goombas(self, x, y, move_direction): 219 | self.get_mobs().append(Goombas(x, y, move_direction)) 220 | 221 | def spawn_koopa(self, x, y, move_direction): 222 | self.get_mobs().append(Koopa(x, y, move_direction)) 223 | 224 | def spawn_flower(self, x, y): 225 | self.mobs.append(Flower(x, y)) 226 | 227 | def spawn_debris(self, x, y, type): 228 | if type == 0: 229 | self.debris.append(PlatformDebris(x, y)) 230 | elif type == 1: 231 | self.debris.append(CoinDebris(x, y)) 232 | 233 | def spawn_fireball(self, x, y, move_direction): 234 | self.projectiles.append(Fireball(x, y, move_direction)) 235 | 236 | def spawn_score_text(self, x, y, score=None): 237 | """ 238 | 239 | This text appears when you, for example, kill a mob. It shows how many points 240 | you got. 241 | 242 | """ 243 | 244 | # Score is none only when you kill a mob. If you got a killstreak, 245 | # amount of points for killing a mob will increase: 100, 200, 400, 800... 246 | # So you don't know how many points you should add. 247 | if score is None: 248 | self.text_objects.append(Text(str(self.score_for_killing_mob), 16, (x, y))) 249 | 250 | # Next score will be bigger 251 | self.score_time = pg.time.get_ticks() 252 | if self.score_for_killing_mob < 1600: 253 | self.score_for_killing_mob *= 2 254 | 255 | # That case for all other situations. 256 | else: 257 | self.text_objects.append(Text(str(score), 16, (x, y))) 258 | 259 | def remove_object(self, object): 260 | self.obj.remove(object) 261 | self.map[object.rect.x // 32][object.rect.y // 32] = 0 262 | 263 | def remove_whizbang(self, whizbang): 264 | self.projectiles.remove(whizbang) 265 | 266 | def remove_text(self, text_object): 267 | self.text_objects.remove(text_object) 268 | 269 | def update_player(self, core): 270 | self.get_player().update(core) 271 | 272 | def update_entities(self, core): 273 | for mob in self.mobs: 274 | mob.update(core) 275 | if not self.in_event: 276 | self.entity_collisions(core) 277 | 278 | def update_time(self, core): 279 | """ 280 | 281 | Updating a map time. 282 | 283 | """ 284 | 285 | # Time updates only if map not in event 286 | if not self.in_event: 287 | self.tick += 1 288 | if self.tick % 40 == 0: 289 | self.time -= 1 290 | self.tick = 0 291 | if self.time == 100 and self.tick == 1: 292 | core.get_sound().start_fast_music(core) 293 | elif self.time == 0: 294 | self.player_death(core) 295 | 296 | def update_score_time(self): 297 | """ 298 | 299 | When player kill mobs in a row, score for each mob 300 | will increase. When player stops kill mobs, points 301 | will reset to 100. This function updates these points. 302 | 303 | """ 304 | if self.score_for_killing_mob != 100: 305 | 306 | # Delay is 750 ms 307 | if pg.time.get_ticks() > self.score_time + 750: 308 | self.score_for_killing_mob //= 2 309 | 310 | def entity_collisions(self, core): 311 | if not core.get_map().get_player().unkillable: 312 | for mob in self.mobs: 313 | mob.check_collision_with_player(core) 314 | 315 | def try_spawn_mobs(self, core): 316 | """ 317 | 318 | These mobs will appear when player will reach the certain x-coordinate 319 | 320 | """ 321 | if self.get_player().rect.x > 2080 and not self.is_mob_spawned[0]: 322 | self.spawn_goombas(2495, 224, False) 323 | self.spawn_goombas(2560, 96, False) 324 | self.is_mob_spawned[0] = True 325 | 326 | elif self.get_player().rect.x > 2460 and not self.is_mob_spawned[1]: 327 | self.spawn_goombas(3200, 352, False) 328 | self.spawn_goombas(3250, 352, False) 329 | self.spawn_koopa(3400, 352, False) 330 | self.spawn_goombas(3700, 352, False) 331 | self.spawn_goombas(3750, 352, False) 332 | self.spawn_goombas(4060, 352, False) 333 | self.spawn_goombas(4110, 352, False) 334 | self.spawn_goombas(4190, 352, False) 335 | self.spawn_goombas(4240, 352, False) 336 | self.is_mob_spawned[1] = True 337 | 338 | def player_death(self, core): 339 | self.in_event = True 340 | self.get_player().reset_jump() 341 | self.get_player().reset_move() 342 | self.get_player().numOfLives -= 1 343 | 344 | if self.get_player().numOfLives == 0: 345 | self.get_event().start_kill(core, game_over=True) 346 | else: 347 | self.get_event().start_kill(core, game_over=False) 348 | 349 | def player_win(self, core): 350 | self.in_event = True 351 | self.get_player().reset_jump() 352 | self.get_player().reset_move() 353 | self.get_event().start_win(core) 354 | 355 | def update(self, core): 356 | 357 | # All mobs 358 | self.update_entities(core) 359 | 360 | if not core.get_map().in_event: 361 | 362 | # When player eats a mushroom 363 | if self.get_player().inLevelUpAnimation: 364 | self.get_player().change_powerlvl_animation() 365 | 366 | # Unlike the level up animation, player can move there 367 | elif self.get_player().inLevelDownAnimation: 368 | self.get_player().change_powerlvl_animation() 369 | self.update_player(core) 370 | 371 | # Common case 372 | else: 373 | self.update_player(core) 374 | 375 | else: 376 | self.get_event().update(core) 377 | 378 | # Debris is 1) Particles which appears when player destroy a brick block 379 | # 2) Coins which appears when player activate a "question" platform 380 | for debris in self.debris: 381 | debris.update(core) 382 | 383 | # Player's fireballs 384 | for whizbang in self.projectiles: 385 | whizbang.update(core) 386 | 387 | # Text which represent how mapy points player get 388 | for text_object in self.text_objects: 389 | text_object.update(core) 390 | 391 | # Camera stops moving when player dies or touches a flag 392 | if not self.in_event: 393 | self.get_camera().update(core.get_map().get_player().rect) 394 | 395 | self.try_spawn_mobs(core) 396 | 397 | self.update_time(core) 398 | self.update_score_time() 399 | 400 | def render_map(self, core): 401 | """ 402 | 403 | Rendering only tiles. It's used in main menu. 404 | 405 | """ 406 | core.screen.blit(self.sky, (0, 0)) 407 | 408 | for obj_group in (self.obj_bg, self.obj): 409 | for obj in obj_group: 410 | obj.render(core) 411 | 412 | for tube in self.tubes: 413 | tube.render(core) 414 | 415 | def render(self, core): 416 | """ 417 | 418 | Renders every object. 419 | 420 | """ 421 | core.screen.blit(self.sky, (0, 0)) 422 | 423 | for obj in self.obj_bg: 424 | obj.render(core) 425 | 426 | for mob in self.mobs: 427 | mob.render(core) 428 | 429 | for obj in self.obj: 430 | obj.render(core) 431 | 432 | for tube in self.tubes: 433 | tube.render(core) 434 | 435 | for whizbang in self.projectiles: 436 | whizbang.render(core) 437 | 438 | for debris in self.debris: 439 | debris.render(core) 440 | 441 | self.flag.render(core) 442 | 443 | for text_object in self.text_objects: 444 | text_object.render_in_game(core) 445 | 446 | self.get_player().render(core) 447 | 448 | self.get_ui().render(core) 449 | -------------------------------------------------------------------------------- /Next/MenuManager.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | from LoadingMenu import LoadingMenu 4 | from MainMenu import MainMenu 5 | 6 | 7 | class MenuManager(object): 8 | """ 9 | 10 | That class allows to easily handle game states. Depending on the situation, 11 | it updates and renders different things. 12 | 13 | """ 14 | def __init__(self, core): 15 | 16 | self.currentGameState = 'MainMenu' 17 | 18 | self.oMainMenu = MainMenu() 19 | self.oLoadingMenu = LoadingMenu(core) 20 | 21 | def update(self, core): 22 | if self.currentGameState == 'MainMenu': 23 | pass 24 | 25 | elif self.currentGameState == 'Loading': 26 | self.oLoadingMenu.update(core) 27 | 28 | elif self.currentGameState == 'Game': 29 | core.get_map().update(core) 30 | 31 | def render(self, core): 32 | if self.currentGameState == 'MainMenu': 33 | core.get_map().render_map(core) 34 | self.oMainMenu.render(core) 35 | 36 | elif self.currentGameState == 'Loading': 37 | self.oLoadingMenu.render(core) 38 | 39 | elif self.currentGameState == 'Game': 40 | core.get_map().render(core) 41 | core.get_map().get_ui().render(core) 42 | 43 | pg.display.update() 44 | 45 | def start_loading(self): 46 | # Start to load the level 47 | self.currentGameState = 'Loading' 48 | self.oLoadingMenu.update_time() 49 | -------------------------------------------------------------------------------- /Next/Mushroom.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | from Entity import Entity 4 | from Const import * 5 | 6 | 7 | class Mushroom(Entity): 8 | def __init__(self, x_pos, y_pos, move_direction): 9 | super().__init__() 10 | 11 | self.rect = pg.Rect(x_pos, y_pos, 32, 32) 12 | 13 | if move_direction: 14 | self.x_vel = 1 15 | else: 16 | self.x_vel = -1 17 | 18 | self.spawned = False 19 | self.spawn_y_offset = 0 20 | self.image = pg.image.load('images/mushroom.png').convert_alpha() 21 | 22 | def check_collision_with_player(self, core): 23 | if self.rect.colliderect(core.get_map().get_player().rect): 24 | core.get_map().get_player().set_powerlvl(2, core) 25 | core.get_map().get_mobs().remove(self) 26 | 27 | def die(self, core, instantly, crushed): 28 | core.get_map().get_mobs().remove(self) 29 | 30 | def spawn_animation(self): 31 | self.spawn_y_offset -= 1 32 | self.rect.y -= 1 33 | 34 | if self.spawn_y_offset == - 32: 35 | self.spawned = True 36 | 37 | def update(self, core): 38 | if self.spawned: 39 | if not self.on_ground: 40 | self.y_vel += GRAVITY 41 | 42 | blocks = core.get_map().get_blocks_for_collision(self.rect.x // 32, self.rect.y // 32) 43 | self.update_x_pos(blocks) 44 | self.update_y_pos(blocks) 45 | 46 | self.check_map_borders(core) 47 | else: 48 | self.spawn_animation() 49 | 50 | def render(self, core): 51 | core.screen.blit(self.image, core.get_map().get_camera().apply(self)) -------------------------------------------------------------------------------- /Next/Platform.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | 4 | class Platform(object): 5 | def __init__(self, x, y, image, type_id): 6 | self.image = image 7 | self.rect = pg.Rect(x, y, 32, 32) 8 | 9 | # 22 - question block 10 | # 23 - brick block 11 | self.typeID = type_id 12 | 13 | self.type = 'Platform' 14 | 15 | self.shaking = False 16 | self.shakingUp = True 17 | self.shakeOffset = 0 18 | 19 | if self.typeID == 22: 20 | self.currentImage = 0 21 | self.imageTick = 0 22 | self.isActivated = False 23 | self.bonus = 'coin' 24 | 25 | def update(self): 26 | if self.typeID == 22: 27 | self.imageTick += 1 28 | if self.imageTick == 50: 29 | self.currentImage = 1 30 | elif self.imageTick == 60: 31 | self.currentImage = 2 32 | elif self.imageTick == 70: 33 | self.currentImage = 1 34 | elif self.imageTick == 80: 35 | self.currentImage = 0 36 | self.imageTick = 0 37 | 38 | def shake(self): 39 | if self.shakingUp: 40 | self.shakeOffset -= 2 41 | self.rect.y -= 2 42 | else: 43 | self.shakeOffset += 2 44 | self.rect.y += 2 45 | if self.shakeOffset == -20: 46 | self.shakingUp = False 47 | if self.shakeOffset == 0: 48 | self.shaking = False 49 | self.shakingUp = True 50 | 51 | def spawn_bonus(self, core): 52 | self.isActivated = True 53 | self.shaking = True 54 | self.imageTick = 0 55 | self.currentImage = 3 56 | 57 | if self.bonus == 'mushroom': 58 | core.get_sound().play('mushroom_appear', 0, 0.5) 59 | if core.get_map().get_player().powerLVL == 0: 60 | core.get_map().spawn_mushroom(self.rect.x, self.rect.y) 61 | else: 62 | core.get_map().spawn_flower(self.rect.x, self.rect.y) 63 | 64 | elif self.bonus == 'coin': 65 | core.get_sound().play('coin', 0, 0.5) 66 | core.get_map().spawn_debris(self.rect.x + 8, self.rect.y - 32, 1) 67 | core.get_map().get_player().add_coins(1) 68 | core.get_map().get_player().add_score(200) 69 | 70 | def destroy(self, core): 71 | core.get_map().spawn_debris(self.rect.x, self.rect.y, 0) 72 | core.get_map().remove_object(self) 73 | 74 | def render(self, core): 75 | 76 | # Question block 77 | if self.typeID == 22: 78 | if not self.isActivated: 79 | self.update() 80 | elif self.shaking: 81 | self.shake() 82 | core.screen.blit(self.image[self.currentImage], core.get_map().get_camera().apply(self)) 83 | 84 | # Brick block 85 | elif self.typeID == 23 and self.shaking: 86 | self.shake() 87 | core.screen.blit(self.image, core.get_map().get_camera().apply(self)) 88 | 89 | else: 90 | core.screen.blit(self.image, core.get_map().get_camera().apply(self)) 91 | -------------------------------------------------------------------------------- /Next/PlatformDebris.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | from Const import * 4 | 5 | 6 | class PlatformDebris(object): 7 | """ 8 | 9 | Debris which appears when you destroy a brick block. 10 | 11 | """ 12 | def __init__(self, x_pos, y_pos): 13 | self.image = pg.image.load('images/block_debris0.png').convert_alpha() 14 | 15 | # 4 different parts 16 | self.rectangles = [ 17 | pg.Rect(x_pos - 20, y_pos + 16, 16, 16), 18 | pg.Rect(x_pos - 20, y_pos - 16, 16, 16), 19 | pg.Rect(x_pos + 20, y_pos + 16, 16, 16), 20 | pg.Rect(x_pos + 20, y_pos - 16, 16, 16) 21 | ] 22 | self.y_vel = -4 23 | self.rect = None 24 | 25 | def update(self, core): 26 | self.y_vel += GRAVITY * FALL_MULTIPLIER 27 | 28 | for i in range(len(self.rectangles)): 29 | self.rectangles[i].y += self.y_vel 30 | if i < 2: 31 | self.rectangles[i].x -= 1 32 | else: 33 | self.rectangles[i].x += 1 34 | 35 | if self.rectangles[1].y > core.get_map().mapSize[1] * 32: 36 | core.get_map().debris.remove(self) 37 | 38 | def render(self, core): 39 | for rect in self.rectangles: 40 | self.rect = rect 41 | core.screen.blit(self.image, core.get_map().get_camera().apply(self)) 42 | -------------------------------------------------------------------------------- /Next/Player.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | from Const import * 4 | 5 | 6 | class Player(object): 7 | def __init__(self, x_pos, y_pos): 8 | self.numOfLives = 3 9 | self.score = 0 10 | self.coins = 0 11 | 12 | self.visible = True 13 | self.spriteTick = 0 14 | self.powerLVL = 0 15 | 16 | self.unkillable = False 17 | self.unkillableTime = 0 18 | 19 | self.inLevelUpAnimation = False 20 | self.inLevelUpAnimationTime = 0 21 | self.inLevelDownAnimation = False 22 | self.inLevelDownAnimationTime = 0 23 | 24 | self.already_jumped = False 25 | self.next_jump_time = 0 26 | self.next_fireball_time = 0 27 | self.x_vel = 0 28 | self.y_vel = 0 29 | self.direction = True 30 | self.on_ground = False 31 | self.fast_moving = False 32 | 33 | self.pos_x = x_pos 34 | 35 | self.image = pg.image.load('images/mario/mario.png').convert_alpha() 36 | self.sprites = [] 37 | self.load_sprites() 38 | 39 | self.rect = pg.Rect(x_pos, y_pos, 32, 32) 40 | 41 | def load_sprites(self): 42 | self.sprites = [ 43 | # 0 Small, stay 44 | pg.image.load('images/Mario/mario.png'), 45 | 46 | # 1 Small, move 0 47 | pg.image.load('images/Mario/mario_move0.png'), 48 | 49 | # 2 Small, move 1 50 | pg.image.load('images/Mario/mario_move1.png'), 51 | 52 | # 3 Small, move 2 53 | pg.image.load('images/Mario/mario_move2.png'), 54 | 55 | # 4 Small, jump 56 | pg.image.load('images/Mario/mario_jump.png'), 57 | 58 | # 5 Small, end 0 59 | pg.image.load('images/Mario/mario_end.png'), 60 | 61 | # 6 Small, end 1 62 | pg.image.load('images/Mario/mario_end1.png'), 63 | 64 | # 7 Small, stop 65 | pg.image.load('images/Mario/mario_st.png'), 66 | 67 | # ============================================= 68 | 69 | # 8 Big, stay 70 | pg.image.load('images/Mario/mario1.png'), 71 | 72 | # 9 Big, move 0 73 | pg.image.load('images/Mario/mario1_move0.png'), 74 | 75 | # 10 Big, move 1 76 | pg.image.load('images/Mario/mario1_move1.png'), 77 | 78 | # 11 Big, move 2 79 | pg.image.load('images/Mario/mario1_move2.png'), 80 | 81 | # 12 Big, jump 82 | pg.image.load('images/Mario/mario1_jump.png'), 83 | 84 | # 13 Big, end 0 85 | pg.image.load('images/Mario/mario1_end.png'), 86 | 87 | # 14 Big, end 1 88 | pg.image.load('images/Mario/mario1_end1.png'), 89 | 90 | # 15 Big, stop 91 | pg.image.load('images/Mario/mario1_st.png'), 92 | 93 | # ============================================= 94 | 95 | # 16 Big_fireball, stay 96 | pg.image.load('images/Mario/mario2.png'), 97 | 98 | # 17 Big_fireball, move 0 99 | pg.image.load('images/Mario/mario2_move0.png'), 100 | 101 | # 18 Big_fireball, move 1 102 | pg.image.load('images/Mario/mario2_move1.png'), 103 | 104 | # 19 Big_fireball, move 2 105 | pg.image.load('images/Mario/mario2_move2.png'), 106 | 107 | # 20 Big_fireball, jump 108 | pg.image.load('images/Mario/mario2_jump.png'), 109 | 110 | # 21 Big_fireball, end 0 111 | pg.image.load('images/Mario/mario2_end.png'), 112 | 113 | # 22 Big_fireball, end 1 114 | pg.image.load('images/Mario/mario2_end1.png'), 115 | 116 | # 23 Big_fireball, stop 117 | pg.image.load('images/Mario/mario2_st.png'), 118 | ] 119 | 120 | # Left side 121 | for i in range(len(self.sprites)): 122 | self.sprites.append(pg.transform.flip(self.sprites[i], 180, 0)) 123 | 124 | # Power level changing, right 125 | self.sprites.append(pg.image.load('images/Mario/mario_lvlup.png').convert_alpha()) 126 | 127 | # Power level changing, left 128 | self.sprites.append(pg.transform.flip(self.sprites[-1], 180, 0)) 129 | 130 | # Death 131 | self.sprites.append(pg.image.load('images/Mario/mario_death.png').convert_alpha()) 132 | 133 | def update(self, core): 134 | self.player_physics(core) 135 | self.update_image(core) 136 | self.update_unkillable_time() 137 | 138 | def player_physics(self, core): 139 | if core.keyR: 140 | self.x_vel += SPEED_INCREASE_RATE 141 | self.direction = True 142 | if core.keyL: 143 | self.x_vel -= SPEED_INCREASE_RATE 144 | self.direction = False 145 | if not core.keyU: 146 | self.already_jumped = False 147 | elif core.keyU: 148 | if self.on_ground and not self.already_jumped: 149 | self.y_vel = -JUMP_POWER 150 | self.already_jumped = True 151 | self.next_jump_time = pg.time.get_ticks() + 750 152 | if self.powerLVL >= 1: 153 | core.get_sound().play('big_mario_jump', 0, 0.5) 154 | else: 155 | core.get_sound().play('small_mario_jump', 0, 0.5) 156 | 157 | # Fireball shoot and fast moving 158 | self.fast_moving = False 159 | if core.keyShift: 160 | self.fast_moving = True 161 | if self.powerLVL == 2: 162 | if pg.time.get_ticks() > self.next_fireball_time: 163 | if not (self.inLevelUpAnimation or self.inLevelDownAnimation): 164 | if len(core.get_map().projectiles) < 2: 165 | self.shoot_fireball(core, self.rect.x, self.rect.y, self.direction) 166 | 167 | if not (core.keyR or core.keyL): 168 | if self.x_vel > 0: 169 | self.x_vel -= SPEED_DECREASE_RATE 170 | elif self.x_vel < 0: 171 | self.x_vel += SPEED_DECREASE_RATE 172 | else: 173 | if self.x_vel > 0: 174 | if self.fast_moving: 175 | if self.x_vel > MAX_FASTMOVE_SPEED: 176 | self.x_vel = MAX_FASTMOVE_SPEED 177 | else: 178 | if self.x_vel > MAX_MOVE_SPEED: 179 | self.x_vel = MAX_MOVE_SPEED 180 | if self.x_vel < 0: 181 | if self.fast_moving: 182 | if (-self.x_vel) > MAX_FASTMOVE_SPEED: self.x_vel = -MAX_FASTMOVE_SPEED 183 | else: 184 | if (-self.x_vel) > MAX_MOVE_SPEED: 185 | self.x_vel = -MAX_MOVE_SPEED 186 | 187 | # removing the computational error 188 | if 0 < self.x_vel < SPEED_DECREASE_RATE: 189 | self.x_vel = 0 190 | if 0 > self.x_vel > -SPEED_DECREASE_RATE: 191 | self.x_vel = 0 192 | 193 | if not self.on_ground: 194 | # Moving up, button is pressed 195 | if (self.y_vel < 0 and core.keyU): 196 | self.y_vel += GRAVITY 197 | 198 | # Moving up, button is not pressed - low jump 199 | elif (self.y_vel < 0 and not core.keyU): 200 | self.y_vel += GRAVITY * LOW_JUMP_MULTIPLIER 201 | 202 | # Moving down 203 | else: 204 | self.y_vel += GRAVITY * FALL_MULTIPLIER 205 | 206 | if self.y_vel > MAX_FALL_SPEED: 207 | self.y_vel = MAX_FALL_SPEED 208 | 209 | blocks = core.get_map().get_blocks_for_collision(self.rect.x // 32, self.rect.y // 32) 210 | 211 | self.pos_x += self.x_vel 212 | self.rect.x = self.pos_x 213 | 214 | self.update_x_pos(blocks) 215 | 216 | self.rect.y += self.y_vel 217 | self.update_y_pos(blocks, core) 218 | 219 | # on_ground parameter won't be stable without this piece of code 220 | coord_y = self.rect.y // 32 221 | if self.powerLVL > 0: 222 | coord_y += 1 223 | for block in core.get_map().get_blocks_below(self.rect.x // 32, coord_y): 224 | if block != 0 and block.type != 'BGObject': 225 | if pg.Rect(self.rect.x, self.rect.y + 1, self.rect.w, self.rect.h).colliderect(block.rect): 226 | self.on_ground = True 227 | 228 | # Map border check 229 | if self.rect.y > 448: 230 | core.get_map().player_death(core) 231 | 232 | # End Flag collision check 233 | if self.rect.colliderect(core.get_map().flag.pillar_rect): 234 | core.get_map().player_win(core) 235 | 236 | def set_image(self, image_id): 237 | 238 | # "Dead" sprite 239 | if image_id == len(self.sprites): 240 | self.image = self.sprites[-1] 241 | 242 | elif self.direction: 243 | self.image = self.sprites[image_id + self.powerLVL * 8] 244 | else: 245 | self.image = self.sprites[image_id + self.powerLVL * 8 + 24] 246 | 247 | def update_image(self, core): 248 | 249 | self.spriteTick += 1 250 | if (core.keyShift): 251 | self.spriteTick += 1 252 | 253 | if self.powerLVL in (0, 1, 2): 254 | 255 | if self.x_vel == 0: 256 | self.set_image(0) 257 | self.spriteTick = 0 258 | 259 | # Player is running 260 | elif ( 261 | ((self.x_vel > 0 and core.keyR and not core.keyL) or 262 | (self.x_vel < 0 and core.keyL and not core.keyR)) or 263 | (self.x_vel > 0 and not (core.keyL or core.keyR)) or 264 | (self.x_vel < 0 and not (core.keyL or core.keyR)) 265 | ): 266 | 267 | if (self.spriteTick > 30): 268 | self.spriteTick = 0 269 | 270 | if self.spriteTick <= 10: 271 | self.set_image(1) 272 | elif 11 <= self.spriteTick <= 20: 273 | self.set_image(2) 274 | elif 21 <= self.spriteTick <= 30: 275 | self.set_image(3) 276 | elif self.spriteTick == 31: 277 | self.spriteTick = 0 278 | self.set_image(1) 279 | 280 | # Player decided to move in the another direction, but hasn't stopped yet 281 | elif (self.x_vel > 0 and core.keyL and not core.keyR) or (self.x_vel < 0 and core.keyR and not core.keyL): 282 | self.set_image(7) 283 | self.spriteTick = 0 284 | 285 | if not self.on_ground: 286 | self.spriteTick = 0 287 | self.set_image(4) 288 | 289 | def update_unkillable_time(self): 290 | if self.unkillable: 291 | self.unkillableTime -= 1 292 | if self.unkillableTime == 0: 293 | self.unkillable = False 294 | 295 | def update_x_pos(self, blocks): 296 | for block in blocks: 297 | if block != 0 and block.type != 'BGObject': 298 | block.debugLight = True 299 | if pg.Rect.colliderect(self.rect, block.rect): 300 | if self.x_vel > 0: 301 | self.rect.right = block.rect.left 302 | self.pos_x = self.rect.left 303 | self.x_vel = 0 304 | elif self.x_vel < 0: 305 | self.rect.left = block.rect.right 306 | self.pos_x = self.rect.left 307 | self.x_vel = 0 308 | 309 | def update_y_pos(self, blocks, core): 310 | self.on_ground = False 311 | for block in blocks: 312 | if block != 0 and block.type != 'BGObject': 313 | if pg.Rect.colliderect(self.rect, block.rect): 314 | 315 | if self.y_vel > 0: 316 | self.on_ground = True 317 | self.rect.bottom = block.rect.top 318 | self.y_vel = 0 319 | 320 | elif self.y_vel < 0: 321 | self.rect.top = block.rect.bottom 322 | self.y_vel = -self.y_vel / 3 323 | self.activate_block_action(core, block) 324 | 325 | def activate_block_action(self, core, block): 326 | # Question Block 327 | if block.typeID == 22: 328 | core.get_sound().play('block_hit', 0, 0.5) 329 | if not block.isActivated: 330 | block.spawn_bonus(core) 331 | 332 | # Brick Platform 333 | elif block.typeID == 23: 334 | if self.powerLVL == 0: 335 | block.shaking = True 336 | core.get_sound().play('block_hit', 0, 0.5) 337 | else: 338 | block.destroy(core) 339 | core.get_sound().play('brick_break', 0, 0.5) 340 | self.add_score(50) 341 | 342 | def reset(self, reset_all): 343 | self.direction = True 344 | self.rect.x = 96 345 | self.pos_x = 96 346 | self.rect.y = 351 347 | if self.powerLVL != 0: 348 | self.powerLVL = 0 349 | self.rect.y += 32 350 | self.rect.h = 32 351 | 352 | if reset_all: 353 | self.score = 0 354 | self.coins = 0 355 | self.numOfLives = 3 356 | 357 | self.visible = True 358 | self.spriteTick = 0 359 | self.powerLVL = 0 360 | self.inLevelUpAnimation = False 361 | self.inLevelUpAnimationTime = 0 362 | 363 | self.unkillable = False 364 | self.unkillableTime = 0 365 | 366 | self.inLevelDownAnimation = False 367 | self.inLevelDownAnimationTime = 0 368 | 369 | self.already_jumped = False 370 | self.x_vel = 0 371 | self.y_vel = 0 372 | self.on_ground = False 373 | 374 | def reset_jump(self): 375 | self.y_vel = 0 376 | self.already_jumped = False 377 | 378 | def reset_move(self): 379 | self.x_vel = 0 380 | self.y_vel = 0 381 | 382 | def jump_on_mob(self): 383 | self.already_jumped = True 384 | self.y_vel = -4 385 | self.rect.y -= 6 386 | 387 | def set_powerlvl(self, power_lvl, core): 388 | if self.powerLVL == 0 == power_lvl and not self.unkillable: 389 | core.get_map().player_death(core) 390 | self.inLevelUpAnimation = False 391 | self.inLevelDownAnimation = False 392 | 393 | elif self.powerLVL == 0 and self.powerLVL < power_lvl: 394 | self.powerLVL = 1 395 | core.get_sound().play('mushroom_eat', 0, 0.5) 396 | core.get_map().spawn_score_text(self.rect.x + 16, self.rect.y, score=1000) 397 | self.add_score(1000) 398 | self.inLevelUpAnimation = True 399 | self.inLevelUpAnimationTime = 61 400 | 401 | elif self.powerLVL == 1 and self.powerLVL < power_lvl: 402 | core.get_sound().play('mushroom_eat', 0, 0.5) 403 | core.get_map().spawn_score_text(self.rect.x + 16, self.rect.y, score=1000) 404 | self.add_score(1000) 405 | self.powerLVL = 2 406 | 407 | elif self.powerLVL > power_lvl: 408 | core.get_sound().play('pipe', 0, 0.5) 409 | self.inLevelDownAnimation = True 410 | self.inLevelDownAnimationTime = 200 411 | self.unkillable = True 412 | self.unkillableTime = 200 413 | 414 | else: 415 | core.get_sound().play('mushroom_eat', 0, 0.5) 416 | core.get_map().spawn_score_text(self.rect.x + 16, self.rect.y, score=1000) 417 | self.add_score(1000) 418 | 419 | def change_powerlvl_animation(self): 420 | 421 | if self.inLevelDownAnimation: 422 | self.inLevelDownAnimationTime -= 1 423 | 424 | if self.inLevelDownAnimationTime == 0: 425 | self.inLevelDownAnimation = False 426 | self.visible = True 427 | elif self.inLevelDownAnimationTime % 20 == 0: 428 | if self.visible: 429 | self.visible = False 430 | else: 431 | self.visible = True 432 | if self.inLevelDownAnimationTime == 100: 433 | self.powerLVL = 0 434 | self.rect.y += 32 435 | self.rect.h = 32 436 | 437 | elif self.inLevelUpAnimation: 438 | self.inLevelUpAnimationTime -= 1 439 | 440 | if self.inLevelUpAnimationTime == 0: 441 | self.inLevelUpAnimation = False 442 | self.rect.y -= 32 443 | self.rect.h = 64 444 | 445 | elif self.inLevelUpAnimationTime in (60, 30): 446 | self.image = self.sprites[-3] if self.direction else self.sprites[-2] 447 | self.rect.y -= 16 448 | self.rect.h = 48 449 | 450 | elif self.inLevelUpAnimationTime in (45, 15): 451 | self.image = self.sprites[0] if self.direction else self.sprites[24] 452 | self.rect.y += 16 453 | self.rect.h = 32 454 | 455 | def flag_animation_move(self, core, walk_to_castle): 456 | if walk_to_castle: 457 | self.direction = True 458 | 459 | if not self.on_ground: 460 | self.y_vel += GRAVITY if self.y_vel <= MAX_FALL_SPEED else 0 461 | 462 | x = self.rect.x // 32 463 | y = self.rect.y // 32 464 | blocks = core.get_map().get_blocks_for_collision(x, y) 465 | 466 | self.rect.x += self.x_vel 467 | if self.rect.colliderect(core.get_map().map[205][11]): 468 | self.visible = False 469 | core.get_map().get_event().player_in_castle = True 470 | self.update_x_pos(blocks) 471 | 472 | self.rect.top += self.y_vel 473 | self.update_y_pos(blocks, core) 474 | 475 | # on_ground works incorrect without this piece of code 476 | x = self.rect.x // 32 477 | y = self.rect.y // 32 478 | if self.powerLVL > 0: 479 | y += 1 480 | for block in core.get_map().get_blocks_below(x, y): 481 | if block != 0 and block.type != 'BGObject': 482 | if pg.Rect(self.rect.x, self.rect.y + 1, self.rect.w, self.rect.h).colliderect(block.rect): 483 | self.on_ground = True 484 | 485 | else: 486 | if core.get_map().flag.flag_rect.y + 20 > self.rect.y + self.rect.h: 487 | self.rect.y += 3 488 | 489 | def shoot_fireball(self, core, x, y, move_direction): 490 | core.get_map().spawn_fireball(x, y, move_direction) 491 | core.get_sound().play('fireball', 0, 0.5) 492 | self.next_fireball_time = pg.time.get_ticks() + 400 493 | 494 | def add_coins(self, count): 495 | self.coins += count 496 | 497 | def add_score(self, count): 498 | self.score += count 499 | 500 | def render(self, core): 501 | if self.visible: 502 | core.screen.blit(self.image, core.get_map().get_camera().apply(self)) 503 | -------------------------------------------------------------------------------- /Next/Sound.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | 4 | class Sound(object): 5 | def __init__(self): 6 | self.sounds = {} 7 | self.load_sounds() 8 | 9 | def load_sounds(self): 10 | self.sounds['overworld'] = pg.mixer.Sound('sounds/overworld.wav') 11 | self.sounds['overworld_fast'] = pg.mixer.Sound('sounds/overworld-fast.wav') 12 | self.sounds['level_end'] = pg.mixer.Sound('sounds/levelend.wav') 13 | self.sounds['coin'] = pg.mixer.Sound('sounds/coin.wav') 14 | self.sounds['small_mario_jump'] = pg.mixer.Sound('sounds/jump.wav') 15 | self.sounds['big_mario_jump'] = pg.mixer.Sound('sounds/jumpbig.wav') 16 | self.sounds['brick_break'] = pg.mixer.Sound('sounds/blockbreak.wav') 17 | self.sounds['block_hit'] = pg.mixer.Sound('sounds/blockhit.wav') 18 | self.sounds['mushroom_appear'] = pg.mixer.Sound('sounds/mushroomappear.wav') 19 | self.sounds['mushroom_eat'] = pg.mixer.Sound('sounds/mushroomeat.wav') 20 | self.sounds['death'] = pg.mixer.Sound('sounds/death.wav') 21 | self.sounds['pipe'] = pg.mixer.Sound('sounds/pipe.wav') 22 | self.sounds['kill_mob'] = pg.mixer.Sound('sounds/kill_mob.wav') 23 | self.sounds['game_over'] = pg.mixer.Sound('sounds/gameover.wav') 24 | self.sounds['scorering'] = pg.mixer.Sound('sounds/scorering.wav') 25 | self.sounds['fireball'] = pg.mixer.Sound('sounds/fireball.wav') 26 | self.sounds['shot'] = pg.mixer.Sound('sounds/shot.wav') 27 | 28 | def play(self, name, loops, volume): 29 | self.sounds[name].play(loops=loops) 30 | self.sounds[name].set_volume(volume) 31 | 32 | def stop(self, name): 33 | self.sounds[name].stop() 34 | 35 | def start_fast_music(self, core): 36 | if core.get_map().get_name() == '1-1': 37 | self.stop('overworld') 38 | self.play('overworld_fast', 99999, 0.5) -------------------------------------------------------------------------------- /Next/Text.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | 4 | class Text(object): 5 | def __init__(self, text, fontsize, rectcenter, font='Emulogic', textcolor = (255, 255, 255)): 6 | self.font = pg.font.Font('fonts/emulogic.ttf', fontsize) 7 | self.text = self.font.render(text, False, textcolor) 8 | self.rect = self.text.get_rect(center=rectcenter) 9 | self.y_offset = 0 10 | 11 | def update(self, core): 12 | self.rect.y -= 1 13 | self.y_offset -= 1 14 | 15 | if self.y_offset == -100: 16 | core.get_map().remove_text(self) 17 | 18 | def render(self, core): 19 | core.screen.blit(self.text, self.rect) 20 | 21 | def render_in_game(self, core): 22 | core.screen.blit(self.text, core.get_map().get_camera().apply(self)) 23 | -------------------------------------------------------------------------------- /Next/Tube.py: -------------------------------------------------------------------------------- 1 | import pygame as pg 2 | 3 | 4 | class Tube(pg.sprite.Sprite): 5 | def __init__(self, x_pos, y_pos): 6 | super().__init__() 7 | self.image = pg.image.load('images/tube.png').convert_alpha() 8 | length = (12 - y_pos) * 32 9 | self.image = self.image.subsurface(0, 0, 64, length) 10 | self.rect = pg.Rect(x_pos * 32, y_pos * 32, 64, length) 11 | 12 | def render(self, core): 13 | core.screen.blit(self.image, core.get_map().get_camera().apply(self)) 14 | -------------------------------------------------------------------------------- /Next/fonts/emulogic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/fonts/emulogic.ttf -------------------------------------------------------------------------------- /Next/images/Mario/mario.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario.png -------------------------------------------------------------------------------- /Next/images/Mario/mario1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario1.png -------------------------------------------------------------------------------- /Next/images/Mario/mario1_end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario1_end.png -------------------------------------------------------------------------------- /Next/images/Mario/mario1_end1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario1_end1.png -------------------------------------------------------------------------------- /Next/images/Mario/mario1_jump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario1_jump.png -------------------------------------------------------------------------------- /Next/images/Mario/mario1_move0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario1_move0.png -------------------------------------------------------------------------------- /Next/images/Mario/mario1_move1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario1_move1.png -------------------------------------------------------------------------------- /Next/images/Mario/mario1_move2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario1_move2.png -------------------------------------------------------------------------------- /Next/images/Mario/mario1_st.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario1_st.png -------------------------------------------------------------------------------- /Next/images/Mario/mario2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2.png -------------------------------------------------------------------------------- /Next/images/Mario/mario2_end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2_end.png -------------------------------------------------------------------------------- /Next/images/Mario/mario2_end1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2_end1.png -------------------------------------------------------------------------------- /Next/images/Mario/mario2_jump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2_jump.png -------------------------------------------------------------------------------- /Next/images/Mario/mario2_move0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2_move0.png -------------------------------------------------------------------------------- /Next/images/Mario/mario2_move1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2_move1.png -------------------------------------------------------------------------------- /Next/images/Mario/mario2_move2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2_move2.png -------------------------------------------------------------------------------- /Next/images/Mario/mario2_st.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2_st.png -------------------------------------------------------------------------------- /Next/images/Mario/mario2s.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2s.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario2s_end.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2s_end.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario2s_end1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2s_end1.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario2s_jump.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2s_jump.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario2s_move0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2s_move0.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario2s_move1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2s_move1.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario2s_move2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2s_move2.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario2s_st.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario2s_st.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_death.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_death.png -------------------------------------------------------------------------------- /Next/images/Mario/mario_end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_end.png -------------------------------------------------------------------------------- /Next/images/Mario/mario_end1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_end1.png -------------------------------------------------------------------------------- /Next/images/Mario/mario_jump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_jump.png -------------------------------------------------------------------------------- /Next/images/Mario/mario_lvlup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_lvlup.png -------------------------------------------------------------------------------- /Next/images/Mario/mario_move0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_move0.png -------------------------------------------------------------------------------- /Next/images/Mario/mario_move1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_move1.png -------------------------------------------------------------------------------- /Next/images/Mario/mario_move2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_move2.png -------------------------------------------------------------------------------- /Next/images/Mario/mario_s0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s0.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s0_death.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s0_death.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s0_end.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s0_end.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s0_end1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s0_end1.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s0_jump.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s0_jump.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s0_move0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s0_move0.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s0_move1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s0_move1.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s0_move2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s0_move2.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s0_st.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s0_st.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s1.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s1_death.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s1_death.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s1_end.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s1_end.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s1_end1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s1_end1.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s1_jump.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s1_jump.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s1_move0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s1_move0.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s1_move1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s1_move1.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s1_move2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s1_move2.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_s1_st.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_s1_st.bmp -------------------------------------------------------------------------------- /Next/images/Mario/mario_st.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/Mario/mario_st.png -------------------------------------------------------------------------------- /Next/images/block_debris0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/block_debris0.png -------------------------------------------------------------------------------- /Next/images/block_debris1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/block_debris1.png -------------------------------------------------------------------------------- /Next/images/coin_an0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/coin_an0.png -------------------------------------------------------------------------------- /Next/images/coin_an1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/coin_an1.png -------------------------------------------------------------------------------- /Next/images/coin_an2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/coin_an2.png -------------------------------------------------------------------------------- /Next/images/coin_an3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/coin_an3.png -------------------------------------------------------------------------------- /Next/images/fireball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/fireball.png -------------------------------------------------------------------------------- /Next/images/firework0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/firework0.png -------------------------------------------------------------------------------- /Next/images/firework1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/firework1.png -------------------------------------------------------------------------------- /Next/images/firework2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/firework2.png -------------------------------------------------------------------------------- /Next/images/flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/flag.png -------------------------------------------------------------------------------- /Next/images/flag_pillar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/flag_pillar.png -------------------------------------------------------------------------------- /Next/images/flower0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/flower0.png -------------------------------------------------------------------------------- /Next/images/flower1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/flower1.png -------------------------------------------------------------------------------- /Next/images/flower2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/flower2.png -------------------------------------------------------------------------------- /Next/images/flower3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/flower3.png -------------------------------------------------------------------------------- /Next/images/goombas_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/goombas_0.png -------------------------------------------------------------------------------- /Next/images/goombas_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/goombas_1.png -------------------------------------------------------------------------------- /Next/images/goombas_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/goombas_dead.png -------------------------------------------------------------------------------- /Next/images/gr_cl_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/gr_cl_big.png -------------------------------------------------------------------------------- /Next/images/gr_cl_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/gr_cl_small.png -------------------------------------------------------------------------------- /Next/images/koopa_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/koopa_0.png -------------------------------------------------------------------------------- /Next/images/koopa_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/koopa_1.png -------------------------------------------------------------------------------- /Next/images/koopa_dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/koopa_dead.png -------------------------------------------------------------------------------- /Next/images/mountain_tiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/mountain_tiles.png -------------------------------------------------------------------------------- /Next/images/mushroom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/mushroom.png -------------------------------------------------------------------------------- /Next/images/super_mario_bros.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/super_mario_bros.png -------------------------------------------------------------------------------- /Next/images/tube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/images/tube.png -------------------------------------------------------------------------------- /Next/main.py: -------------------------------------------------------------------------------- 1 | from Core import Core 2 | 3 | if __name__ == '__main__': 4 | oCore = Core() 5 | oCore.main_loop() 6 | -------------------------------------------------------------------------------- /Next/sounds/blockbreak.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/blockbreak.wav -------------------------------------------------------------------------------- /Next/sounds/blockhit.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/blockhit.wav -------------------------------------------------------------------------------- /Next/sounds/coin.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/coin.wav -------------------------------------------------------------------------------- /Next/sounds/death.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/death.wav -------------------------------------------------------------------------------- /Next/sounds/fireball.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/fireball.wav -------------------------------------------------------------------------------- /Next/sounds/gameover.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/gameover.wav -------------------------------------------------------------------------------- /Next/sounds/jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/jump.wav -------------------------------------------------------------------------------- /Next/sounds/jumpbig.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/jumpbig.wav -------------------------------------------------------------------------------- /Next/sounds/kill_mob.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/kill_mob.wav -------------------------------------------------------------------------------- /Next/sounds/levelend.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/levelend.wav -------------------------------------------------------------------------------- /Next/sounds/mushroomappear.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/mushroomappear.wav -------------------------------------------------------------------------------- /Next/sounds/mushroomeat.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/mushroomeat.wav -------------------------------------------------------------------------------- /Next/sounds/overworld-fast.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/overworld-fast.wav -------------------------------------------------------------------------------- /Next/sounds/overworld.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/overworld.wav -------------------------------------------------------------------------------- /Next/sounds/pipe.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/pipe.wav -------------------------------------------------------------------------------- /Next/sounds/scorering.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/scorering.wav -------------------------------------------------------------------------------- /Next/sounds/shot.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/sounds/shot.wav -------------------------------------------------------------------------------- /Next/worlds/1-1/W11.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 7 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,9,9,9,13,0,0,0,0,11,9,9,13,0,0,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 46 | 47 | 48 | -------------------------------------------------------------------------------- /Next/worlds/1-1/tiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Winter091/MarioPygame/d4e1e438c8ca544b445b3d22f0552e761b1ea64a/Next/worlds/1-1/tiles.png -------------------------------------------------------------------------------- /Next/worlds/1-1/tiles.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MarioPygame 2 | 3 | A python remake of the classic Super Mario Bros. 4 | 5 | * [YouTube link](https://www.youtube.com/watch?v=WCkBDyX0qNI) 6 | 7 | ## About 8 | **Note: The code is a bit messy. Live with it. 9 | At the moment I was writing it I was a complete beginner so I was using 10 | [this](https://github.com/jakowskidev/uMario_Jakowski) project as a reference.** 11 | 12 | The game based on pygame with loading .tmx level using pytmx. 13 | 14 | Only level 1-1 was finished. 15 | 16 | That's how main menu looks: 17 | 18 | ![Main Menu](https://github.com/Winter091/MarioPygame/blob/master/Mario.png) 19 | 20 | 21 | And gameplay: 22 | 23 | ![Gameplay](https://github.com/Winter091/MarioPygame/blob/master/Mario_gameplay.png) 24 | 25 | ## Starting 26 | Install these python libraries: 27 | ``` 28 | pip install pygame 29 | pip install pytmx 30 | ``` 31 | 32 | Then execute 'Next/main.py'. 33 | 34 | --------------------------------------------------------------------------------