def __init__(self, instance):
     Entity.__init__(self, instance)
     self.rand = random.Random()
     self.last_position = None
     self.width, self.height = value[
         "init.virtual_width"] / self.d + 2, value[
             "init.virtual_height"] / self.d + 2
     self.matrix = create_matrix(ceil(self.height), ceil(self.width))
Пример #2
0
    def __init__(self, instance, position, arrow_enable=True):
        Entity.__init__(self, instance)
        self.position = position
        self.radius = value["pickup.size"]
        if arrow_enable:

            self.arrow = Arrow(self, self.instance, PURPLE, 1)
            self.instance.create(self.arrow)
Пример #3
0
    def __init__(self, instance, target, offset=(0, 0)):
        Entity.__init__(self, instance)
        self.target = target
        self.offset = offset

        self.last_frames = []

        self.rect = Rect(sub_rectangular(self.position, (0, 0)),
                         scale_rectangular(self.offset, -2))
    def __init__(self, instance, target, color, size):
        Entity.__init__(self, instance)
        self.scale = size
        self.color = color
        self.target = target
        self.base_image = None

        self.ARROW_AXIS_LEFT = value["arrow.left_axis"]
        self.ARROW_AXIS_BOTTOM = value["arrow.bottom_axis"]
        self.ARROW_AXIS_RIGHT = value["arrow.right_axis"]
        self.ARROW_AXIS_TOP = value["arrow.top_axis"]
        self.my_font = font["arrow_font"]
        self.create_base()
    def __init__(self,
                 owner=None,
                 instance=None,
                 position=(0, 0),
                 velocity=(0, 0),
                 rotation=0):
        self.position = position
        Entity.__init__(self, instance)

        self.velocity = velocity
        self._rotation = rotation
        self.radius = value["projectile.size"]
        self._current_rotation = None
        self.rotation = rotation
 def __init__(self,
              instance,
              position=(0, 0),
              text="",
              color=WHITE,
              new_font=font,
              get_text_function=None):
     Entity.__init__(self, instance)
     self.my_font = new_font
     self.text = text
     self.color = color
     self.drawable = Drawable(None, None, True, False)
     self.position = position
     self.get_text_function = get_text_function
Пример #7
0
    def __init__(self, instance, position=(0, 0), template=None):
        Entity.__init__(self, instance)
        self.create_drawable()
        self.position = position
        self.health = value["ship.health"] - 1
        self.max_health = value["ship.health"]
        self.fuel = 100
        self.max_fuel = 200
        self.base_image = texture["ship"]
        self.base_image_fire = texture["ship_fire"]
        self.deacceleration = value["ship.deacceleration"]
        self.auto_deacceleration = value["ship.auto_deacceleration"]
        self.angular_speed = value["ship.rotation_speed"]
        self.side_acceleration = value["ship.thruster_acceleration"]
        self.acceleration = value["ship.acceleration"]
        self.max_velocity = value["ship.max_speed"]

        self.weapon = weapon_class.TripleBasicKineticWeapon()
 def update(self, delta_time):
     Entity.update(self, delta_time)
     if self._current_rotation is not self.rotation and self.image is not None:
         self.drawable.image = pygame.transform.rotate(
             self.image, -180 / pi * self.rotation)
         self._current_rotation = self.rotation
Пример #9
0
 def __init__(self, dictionary=None):
     Entity.__init__(self)
Пример #10
0
 def update(self, delta_time):
     Entity.update(self, delta_time)
     #self.image_rotation = self.velocity_polar[1]
     self.timer = self.timer + delta_time
     if self.timer > self.bullet_duration:
         self.instance.remove(self)
Пример #11
0
 def __init__(self, instance):
     self.base_projectile = Projectile(instance, None, None, None)
     Entity.__init__(self, instance)
     if instance is not None:
         self.arrow = Arrow(instance, self, RED, 1)
         self.instance.create(self.arrow)