Beispiel #1
0
    def __init__(self, trajectory, pos):
        BaseObject.__init__(self, "Bullet.png", pos, SPRITE_MANAGER.instance)
        self.trajectory = trajectory

        self.delete = False
        self.redius = self.rect.centerx - self.rect.centery

        BULLET_MANAGER.instance.add(self)
        self.speed = 5
        self.collided = False
 def __init__(self, sprite_name, controller, pos, planet):
     BaseObject.__init__(self, sprite_name, pos, SPRITE_MANAGER.instance)
     self.joystick = controller
     self.speed = 0
     self.planet = planet
     self.landed = False
     self.got_angle = False
     self.radius = self.rect.centerx - self.rect.x
     self.old_image = self.image
     self.taking_off = False
Beispiel #3
0
    def __init__(self, trajectory, pos):
        BaseObject.__init__(self, "Bullet.png", pos, SPRITE_MANAGER.instance)
        self.trajectory = trajectory

        self.delete = False
        self.redius = self.rect.centerx - self.rect.centery

        BULLET_MANAGER.instance.add(self)
        self.speed = 5
        self.collided = False
Beispiel #4
0
    def __init__(self, angle, pos):
        BaseObject.__init__(self, "pink_bullet.png", pos, SPRITE_MANAGER.instance)
        rads = radians(angle)
        self.direction = Vector(sin(rads), cos(rads)).normal()
        self.delete = False

        BULLET_MANAGER.instance.add(self)
        self.speed = 30
        self.collided = False
        self._rotate(angle)
Beispiel #5
0
 def __init__(self, sprite_name, controller, pos, planet):
     BaseObject.__init__(self, sprite_name, pos, SPRITE_MANAGER.instance)
     self.joystick = controller
     self.speed = 0
     self.planet = planet
     self.landed = False
     self.got_angle = False
     self.radius = self.rect.centerx - self.rect.x
     self.old_image = self.image
     self.taking_off = False
Beispiel #6
0
    def __init__(self, angle, pos):
        BaseObject.__init__(self, "pink_bullet.png", pos,
                            SPRITE_MANAGER.instance)
        rads = radians(angle)
        self.direction = Vector(sin(rads), cos(rads)).normal()
        self.delete = False

        BULLET_MANAGER.instance.add(self)
        self.speed = 30
        self.collided = False
        self._rotate(angle)
Beispiel #7
0
    def __init__(self, sprite_name, controller, pos):
        BaseObject.__init__(self, sprite_name, pos, SPRITE_MANAGER.instance)

        # assumes an already initialized controller
        # TODO: Create virtual controller - currently we rely on PS3 controller
        self.joystick = controller
        self.land = False
        self.can_shoot = 1
        self.can_move = 1

        self.trajectory = Vector(0, 0)
        self.begun_movement = False  # Could eliminate this by having the player already moving at start...

        # TODO: get rid of this line of code, since we will be using a rect mask for collisions...
        self.radius = self.rect.centerx - self.rect.x

        self.old_hspeed, self.old_vspeed = 0, 0
        self.hspeed, self.vspeed = 0, 0

        self.fire_sound = load_sound("321102__nsstudios__laser1.wav")

        self.health = HEALTH
        self.bullet_group = GroupWithOwner(owner=self.name, group_manager=BULLET_GROUP_MANAGER)
Beispiel #8
0
    def __init__(self, sprite_name, controller, pos):
        BaseObject.__init__(self, sprite_name, pos, SPRITE_MANAGER.instance)

        # assumes an already initialized controller
        # TODO: Create virtual controller - currently we rely on PS3 controller
        self.joystick = controller
        self.land = False
        self.can_shoot = 1
        self.can_move = 1

        self.trajectory = Vector(0, 0)
        self.begun_movement = False  # Could eliminate this by having the player already moving at start...

        # TODO: get rid of this line of code, since we will be using a rect mask for collisions...
        self.radius = self.rect.centerx - self.rect.x

        self.old_hspeed, self.old_vspeed = 0, 0
        self.hspeed, self.vspeed = 0, 0

        self.fire_sound = load_sound("321102__nsstudios__laser1.wav")

        self.health = HEALTH
        self.bullet_group = GroupWithOwner(owner=self.name,
                                           group_manager=BULLET_GROUP_MANAGER)
Beispiel #9
0
    def __init__(self, sprite_name, pos, debug=None):
        BaseObject.__init__(self, sprite_name, pos, SPRITE_MANAGER.instance)

        self.radius = self.rect.centerx - self.rect.x
        PLANET_MANAGER.instance.add(self)
Beispiel #10
0
 def __init__(self, sprite_name, target):
     BaseObject.__init__(self, sprite_name, (target.pos.x, target.pos.y), SPRITE_MANAGER.instance)
     self.target = target
     self.pos = self.target.pos
     self._update_pos()
Beispiel #11
0
    def __init__(self, sprite_name, pos, debug=None):
        BaseObject.__init__(self, sprite_name, pos, SPRITE_MANAGER.instance)

        self.radius = self.rect.centerx - self.rect.x
        PLANET_MANAGER.instance.add(self)