Example #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
Example #2
0
    def __init__(self, random):
        self.sensor_coords = []  # variables for adjustable sensors from LP
        self.random = random
        self.running = True
        self.colliding = False
        self.energized = 0  # positive means energized for that many turns
        self.ghost_multiplier = 1
        self.lives = 3
        self.player_pos = [self.PLAYER_START_X, self.PLAYER_START_Y]
        self.score = 0
        self.extra_life = False
        self.objects = []
        self.turns = 0
        self.level = 0
        self.score_panel = StatusPanel(0, 0, self.MAP_WIDTH, 3)
        self.panels = [self.score_panel]
        self.pellets_eaten = 0
        self.fruit_visible = -1

        # array of ghost objects
        # ghosts use the functions in the PacBot object
        self.ghosts = {}
        self.ghosts['blinky'] = Ghost("blinky", self.BLINKY, self.EDIBLE_BLINKY, self.BLINKY_START_X, self.BLINKY_START_Y)
        self.ghosts['pinky'] = Ghost("pinky", self.PINKY, self.EDIBLE_PINKY, self.PINKY_START_X, self.PINKY_START_Y)
        self.ghosts['inky'] = Ghost("inky", self.INKY, self.EDIBLE_INKY, self.INKY_START_X, self.INKY_START_Y)
        self.ghosts['clyde'] = Ghost("clyde", self.CLYDE, self.EDIBLE_CLYDE, self.CLYDE_START_X, self.CLYDE_START_Y)
Example #3
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")
Example #4
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")
Example #5
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()
Example #6
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()