Beispiel #1
0
# The board
obj_board = Board(HT, WIDTH)
obj_board.create_board()

# The player
obj_din = Din(STARTPOS, 35)
obj_din.din_show(obj_board.grid, factor + 1 + STARTPOS, 35, 0)

# The Dragon
obj_dragon = Dragon(WIDTH - len(dragon[0]), HT - 2 - len(dragon) - 1)
obj_dragon.dragon_show(obj_board.grid)

# The background
obj_back = Background()
obj_back.display_ceil(obj_board.grid)
obj_back.display_floor(obj_board.grid)

#The magnet
obj_magnet = Magnet(5, random.randrange(30, WIDTH - 200))
obj_magnet.show(obj_board.grid, obj_magnet.shape, obj_magnet.getx(),
                obj_magnet.gety())


#PRINTING HEADERS
def print_header(newtime):
    print(Fore.WHITE + Back.LIGHTBLUE_EX + Style.BRIGHT +
          "               ".center(SCREEN) + Style.RESET_ALL)
    print(Fore.WHITE + Back.LIGHTBLUE_EX + Style.BRIGHT +
          "THE MANDALORIAN".center(SCREEN) + Style.RESET_ALL)
    print(Fore.WHITE + Back.LIGHTBLUE_EX + Style.BRIGHT +
from board import Board
from paddle import Paddle
from enemy import Enemy
from brick import Brick
from bomb import Bomb
from ball import Ball
from powerup import PowerUp
from background import Background

# The board
board_obj = Board(HEIGHT, WIDTH)
board_obj.create_board()

# The background
bg_obj = Background()
bg_obj.display_ceil(board_obj.grid)
bg_obj.display_left_wall(board_obj.grid)
bg_obj.display_right_wall(board_obj.grid)

# The paddle
paddle_obj = Paddle(0, 0)
paddle_obj.show(board_obj.grid, int(WIDTH / 2), int(WIDTH / 2) + PADDLE_LEN)

# The enemy
enemy_obj = Enemy(0, 30)

# Moving balls
ball_obj_array = [Ball(0, 0)]

# Powerups
powerup_obj_array = [PowerUp(0, 0) for i in range(40)]