def __init__(self): GameObject.__init__(self) self.renderer = ImageRenderer(load_image("player.png")) self.position.copy(SCREEN_WIDTH / 2, SCREEN_HEIGHT - 100) self.velocity = Vector2D(0, 0) self.shoot_counter = Counter(7) self.box_collider = BoxCollider(64, 64)
def __init__(self): GameObject.__init__(self) self.velocity = Vector2D(0, 0) self.renderer = TRexAnimator() self.state = TRexState.IDLE self.jump_speed = 14 self.gravity = 1 self.base_y = 0 self.game_restarter = None self.setup_physics() TRex.instance = self
def __init__(self): GameObject.__init__(self) self.velocity = Vector2D(0, 2) self.renderer = ImageRenderer(load_image("enemy.png")) self.box_collider = BoxCollider(64, 64)
def __init__(self): GameObject.__init__(self) self.velocity = Vector2D(0, -10) self.renderer = ImageRenderer(load_image("player-bullet.png")) self.box_collider = BoxCollider(16, 16)
def set_initial_position(self, x, y): self.position = Vector2D(x, y) self.base_y = y
def __init__(self, img): self.image = img self.anchor = Vector2D(0.5, 0.5)
def __init__(self): self.renderer = None self.position = Vector2D(0, 0) self.active = True self.box_collider = None