def destroy(self) :
    if self.dest_sound :
       self.dest_sound.play()
    if self.dest_anim :
       self.dest_anim.m.r.pos = self.m.r.pos.copy()
       self.dest_anim.st.start()
       self.dest_anim.self_destruct = True
       RenderQueue.enqueue(self.dest_anim)
    RenderQueue.dequeue(self)
    UpdateEvent.remove_action(self)
    for container in self.containers :
       if self in container :
          container.remove(self)
    for c in self.children :
       c.destroy()
Beispiel #2
0
 def render(self) :
    glMatrixMode(GL_TEXTURE)
    npi = self.st.get_num_passed_intervals()
    self.cur_frame += npi
    if self.cur_frame > self.num_frames :
       if self.looping :
          self.cur_frame = self.cur_frame % self.num_frames
       else :
          if self.self_destruct :
             RenderQueue.dequeue(self)
    glLoadIdentity()
    glScalef(1.0 / self.num_frames, 1.0, 1.0)
    glTranslatef(self.cur_frame, 0.0, 0.0)
    glMatrixMode(GL_MODELVIEW)
    super().render()
    glMatrixMode(GL_TEXTURE)
    glLoadIdentity()
    glMatrixMode(GL_MODELVIEW)