view pytouhou/game/bullet.pxd @ 525:43ecf0f98f4d

Precalculate the inverse of the texture size at ANM load, to not recalculate at every sprite change.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 18 Dec 2013 18:15:45 +0100
parents 887de1309491
children 3c2f96f1d715
line wrap: on
line source

from pytouhou.game.element cimport Element
from pytouhou.game.game cimport Game
from pytouhou.game.bullettype cimport BulletType
from pytouhou.utils.interpolator cimport Interpolator


cdef enum State:
    LAUNCHING, LAUNCHED, CANCELLED


cdef class Bullet(Element):
    cdef public State state
    cdef public unsigned long flags, frame, sprite_idx_offset, damage
    cdef public double dx, dy, angle, speed
    cdef public bint was_visible, grazed
    cdef public Element target
    cdef public BulletType _bullet_type
    cdef public list attributes

    cdef double hitbox[2]
    cdef Interpolator speed_interpolator
    cdef Game _game
    cdef long player

    cdef bint is_visible(self, unsigned int screen_width, unsigned int screen_height) except? False
    cpdef set_anim(self, sprite_idx_offset=*)
    cdef void launch(self) except *
    cdef void collide(self) except *
    cdef void cancel(self) except *
    cdef void update(self) except *