Example #1
0
    def spawn_collider(self):
        self.collision = dynamic_object.DynamicObject(self.app)
        self.collision.spawn_collider(self.app, pymunk.Circle(None, self.radius),
                                      y=self.pos.y, height=self.height)
        self.collision.collider.damage_object = self

        self.collision.spawn(self.pos.xyz)
Example #2
0
    def __init__(self, app):
        self.app = app

        self.collision = dynamic_object.DynamicObject(self.app, self)
        self.collision.spawn_collider(self.app, pymunk.Circle(None, self.radius),
                                      0, self.height)

        self.collision.collider.damage_object = self

        self.graphics = character.Character(self.app)

        self.collision.spawn((0, 0, 0))

        self.set_state(character.JUMPING)
Example #3
0
    def __init__(self, app):
        self.app = app
        self.collision = dynamic_object.DynamicObject(self.app)
        self.collision.body.velocity_func = self.velocity_func
        self.collision.spawn_collider(self.app,
                                      pymunk.Poly(None, self.vertices), 0,
                                      self.height)

        self.canvas = Canvas()
        with self.canvas.before:
            PushMatrix()

            self.pos = Translate()
            self.rot = Rotate(0, 0, 1, 0)

        with self.canvas.after:
            PopMatrix()

        self.throttle_up = 0
        self.throttle_down = 0
        self.input_vector = [0, 0]
        self.local_vel = pymunk.Vec2d()