home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 124 / cd-rom 124.iso / edu / tuxmath / tuxmathscrabble / asymptopia / Animator.py < prev    next >
Encoding:
Python Source  |  2003-07-26  |  1.7 KB  |  56 lines

  1. #!/usr/bin/python
  2. """
  3. /***************************************************************************
  4.  
  5.     Author             :Charles B. Cosse 
  6.     
  7.     Email            :ccosse@asymptopia.com
  8.                     
  9.     Copyright        :(C) 2002,2003 Asymptopia Software.
  10.     
  11.  ***************************************************************************/
  12. /***************************************************************************
  13.                           Animator.py
  14.  
  15.  
  16.  ***************************************************************************/
  17.  
  18. /***************************************************************************
  19.  *                                                                         *
  20.  *   This program is free software; you can redistribute it and/or modify  *
  21.  *   it under the terms of the GNU General Public License as published by  *
  22.  *   the Free Software Foundation; either version 2 of the License, or     *
  23.  *   (at your option) any later version. (Please note that if you use this *
  24.  *   code you must give credit by including the Author and Copyright       *
  25.  *   info at the top of this file).                                        *
  26.  ***************************************************************************/
  27.  
  28. """
  29.  
  30. import os, pygame,sys
  31. from pygame.locals import *
  32. from random import random
  33.  
  34. class Animator:
  35.     def __init__(self):
  36.         self.characters={}
  37.         self.maneuvers={}#keep separate from chars?
  38.         
  39.     def add_char(self,name,char):
  40.         self.characters[name]=char
  41.     
  42.     def start_maneuver(self,who,which):
  43.         maneuvers=self.maneuvers
  44.         #print 'Animator.maneuvers=',maneuvers
  45.         #print ''
  46.         #print 'Animator setting maneuver=',maneuvers[which]
  47.         self.characters[who].begin_maneuver(maneuvers[which])
  48.         
  49.     
  50.     def define_maneuver(self,name,maneuver):
  51.         self.maneuvers[name]=maneuver
  52.         
  53.     
  54.     
  55.  
  56.