Ejemplo n.º 1
0
    def __init__(self, random):
        self.random = random
        self.running = True
        self.centerx = self.MAP_WIDTH // 2
        self.centery = self.MAP_HEIGHT // 2
        self.player_pos = [self.centerx, (int)(self.MAP_HEIGHT * .99)]
        self.player_right = [self.centerx + 1, (int)(self.MAP_HEIGHT * .99)]
        self.player_left = [self.centerx - 1, (int)(self.MAP_HEIGHT * .99)]
        self.invaders = []
        self.drops_eaten = 0
        self.invaders_left = 0
        self.missiles_left = 0
        self.apple_pos = []
        self.objects = []
        self.turns = 0
        self.bullets_fired = 0
        self.level = 0
        self.gravity_power = 1
        self.bullet_speed = 3
        self.invader_speed = 1
        self.placed_invaders = 0
        self.movement_direction = Direction.RIGHT
        self.msg_panel = MessagePanel(self.MSG_START, self.MAP_HEIGHT + 1, self.SCREEN_WIDTH - self.MSG_START, 5)
        self.status_panel = StatusPanel(0, self.MAP_HEIGHT + 1, self.MSG_START, 5)
        self.panels = [self.msg_panel, self.status_panel]
        self.msg_panel.add("Welcome to " + self.GAME_TITLE + "!!!")
        self.lives = 3
        self.life_lost = False
        self.at_bottom = False

        self.debug = False
Ejemplo n.º 2
0
    def __init__(self, random):
        self.random = random
        self.running = True

        self.player_y = self.MAP_HEIGHT // 2
        self.player_v = 0
        self.x = 0
        self.pipes_passed = 0
        self.pipes = []

        self.msg_panel = MessagePanel(self.MSG_START,
                                      self.MAP_HEIGHT + 1,
                                      self.SCREEN_WIDTH - self.MSG_START,
                                      5,
                                      padding=PanelPadding.create(top=1,
                                                                  right=1,
                                                                  bottom=1))
        self.status_panel = StatusPanel(0,
                                        self.MAP_HEIGHT + 1,
                                        self.MSG_START,
                                        5,
                                        padding=PanelPadding.create(top=1,
                                                                    left=1,
                                                                    bottom=1))
        self.panels = [self.status_panel, self.msg_panel]
        self.msg_panel.add("Welcome to")
        self.msg_panel.add("   " + self.GAME_TITLE + "!!!")
        self.msg_panel.add("Don't hit the pipes")
Ejemplo n.º 3
0
 def __init__(self, random):
     self.random = random
     self.running = True
     self.is_stopping = False
     self.players = []
     self.num_alive = 0
     self.standings = []
     self.turns = 0
     self.level = 1
     self.msg_panel = MessagePanel(self.MSG_START, self.MAP_HEIGHT + 2,
                                   self.SCREEN_WIDTH - self.MSG_START + 1,
                                   4)
     self.status_panel = StatusPanel(0, self.MAP_HEIGHT + 2, self.MSG_START,
                                     4)
     self.panels = [self.msg_panel, self.status_panel]
     self.msg_panel.add("Welcome to Game GRID!!!")
     self.msg_panel.add("Stop The Corruption")
Ejemplo n.º 4
0
    def __init__(self, random):
        self.random = random
        self.running = True
        self.NUM_ENEMIES = 2
        self.enemies = self.NUM_ENEMIES
        self.USER = None
        self.CORRUPTION = []
        self.CORRUPTION_POSITIONS = []
        self.turns = 0
        self.level = 1
        self.msg_panel = MessagePanel(self.MSG_START, self.MAP_HEIGHT + 1,
                                      self.SCREEN_WIDTH - self.MSG_START, 5)
        self.status_panel = StatusPanel(0, self.MAP_HEIGHT + 1, self.MSG_START,
                                        5)
        self.panels = [self.msg_panel, self.status_panel]
        self.msg_panel.add("Welcome to Game GRID!!!")
        self.msg_panel.add("Stop The Corruption")

        self.__create_map()
Ejemplo n.º 5
0
    def __init__(self, random):
        self.random = random
        self.running = True
        self.colliding = False
        self.saved_object = None  # stores a map item we're "on top of"
        self.last_move = 'w'  # need this to restore objects
        self.flying = 0  # set to some value and decrement (0 == on ground)
        self.hp = 1
        self.player_pos = [int(self.MAP_WIDTH / 2), self.MAP_HEIGHT - 4]
        self.score = 0
        self.objects = []
        self.turns = 0
        self.level = 1
        self.msg_panel = MessagePanel(self.MSG_START, self.MAP_HEIGHT + 1,
                                      self.SCREEN_WIDTH - self.MSG_START, 5)
        self.status_panel = StatusPanel(0, self.MAP_HEIGHT + 1, self.MSG_START,
                                        5)
        self.panels = [self.msg_panel, self.status_panel]
        self.msg_panel.add("Velkommen to Robot Backcountry Skiing!")
        self.msg_panel.add("Move left and right! Don't crash!")

        self.__create_map()