comparison pytouhou/game/enemy.pyx @ 527:db28538cd399

Use Sprite C arrays instead of their tuple representation where it makes sense.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 18 Dec 2013 18:19:08 +0100
parents 292fea5c584e
children 53fa73932e9a
comparison
equal deleted inserted replaced
526:0b2a92a25245 527:db28538cd399
308 (0.,), frame + duration - 1, 308 (0.,), frame + duration - 1,
309 formula) 309 formula)
310 310
311 311
312 cdef bint is_visible(self, long screen_width, long screen_height): 312 cdef bint is_visible(self, long screen_width, long screen_height):
313 cdef double tw, th
314
315 if self.sprite is not None: 313 if self.sprite is not None:
316 if self.sprite.corner_relative_placement: 314 if self.sprite.corner_relative_placement:
317 raise Exception #TODO 315 raise Exception #TODO
318 _, _, tw, th = self.sprite.texcoords 316 tw, th = self.sprite._texcoords[2], self.sprite._texcoords[3]
319 else: 317 else:
320 tw, th = 0, 0 318 tw, th = 0., 0.
321 319
322 x, y = self.x, self.y 320 x, y = self.x, self.y
323 max_x = tw / 2 321 max_x = tw / 2
324 max_y = th / 2 322 max_y = th / 2
325 323