comparison pytouhou/ui/sprite.pyx @ 274:f037bca24f2d

Partially implement lasers. “Launch animations”/“energy circles” are missing, aswell as collision and grazing.
author Thibaut Girka <thib@sitedethib.com>
date Sun, 05 Feb 2012 23:41:55 +0100
parents 02de1563fa18
children 3539520fff93
comparison
equal deleted inserted replaced
273:595b227886b1 274:f037bca24f2d
36 36
37 vertmat.scale2d(width, height) 37 vertmat.scale2d(width, height)
38 if sprite.mirrored: 38 if sprite.mirrored:
39 vertmat.flip() 39 vertmat.flip()
40 40
41 if sprite.allow_dest_offset:
42 vertmat.translate(sprite.dest_offset[0], sprite.dest_offset[1], sprite.dest_offset[2])
41 rx, ry, rz = sprite.rotations_3d 43 rx, ry, rz = sprite.rotations_3d
42 if sprite.automatic_orientation: 44 if sprite.automatic_orientation:
43 rz += pi/2. - sprite.angle 45 rz += pi/2. - sprite.angle
44 elif sprite.force_rotation: 46 elif sprite.force_rotation:
45 rz += sprite.angle 47 rz += sprite.angle
49 vertmat.rotate_x(-rx) 51 vertmat.rotate_x(-rx)
50 if ry: 52 if ry:
51 vertmat.rotate_y(ry) 53 vertmat.rotate_y(ry)
52 if rz: 54 if rz:
53 vertmat.rotate_z(-rz) #TODO: minus, really? 55 vertmat.rotate_z(-rz) #TODO: minus, really?
54 if sprite.allow_dest_offset:
55 vertmat.translate(sprite.dest_offset[0], sprite.dest_offset[1], sprite.dest_offset[2])
56 if sprite.corner_relative_placement: # Reposition 56 if sprite.corner_relative_placement: # Reposition
57 vertmat.translate(width / 2., height / 2., 0.) 57 vertmat.translate(width / 2., height / 2., 0.)
58 58
59 x_1 = 1. / sprite.anm.size[0] 59 x_1 = 1. / sprite.anm.size[0]
60 y_1 = 1. / sprite.anm.size[1] 60 y_1 = 1. / sprite.anm.size[1]