platipy / spyral

http://platipy.org
Other
49 stars 12 forks source link

Cannot animate sprite from constructor. #65

Open icarito opened 10 years ago

icarito commented 10 years ago

Here's a full traceback of what happens when I try:

[icarito@aiki Comodo.activity]$ python2 run_game.py
CISC374 Launcher
===================================
launcher version:        0.3       
spyral version:          0.9.7     
resolution:              Autodetect
fullscreen:              False     
Max FPS:                 30        
Locale:                  default   
Profiling:               Disabled  
Traceback (most recent call last):
  File "run_game.py", line 93, in <module>
    launch()
  File "run_game.py", line 74, in launch
    game.main()
  File "/home/icarito/Proyectos/sugar-build/activities/Comodo.activity/game/__init__.py", line 5, in main
    spyral.director.push(escena.Juego(activity))
  File "/home/icarito/Proyectos/sugar-build/activities/Comodo.activity/game/escena.py", line 70, in __init__
    self.fondo1 = Fondo(self, 1)
  File "/home/icarito/Proyectos/sugar-build/activities/Comodo.activity/game/escena.py", line 20, in __init__
    self.avanzo()
  File "/home/icarito/Proyectos/sugar-build/activities/Comodo.activity/game/escena.py", line 25, in avanzo
    self.animate(animacion)
  File "/home/icarito/Proyectos/sugar-build/activities/Comodo.activity/libraries/spyral/spyral/sprite.py", line 551, in animate
    e)
  File "/home/icarito/Proyectos/sugar-build/activities/Comodo.activity/libraries/spyral/spyral/event.py", line 125, in handle
    scene._handle_event(event_name, event)
AttributeError: 'NoneType' object has no attribute '_handle_event'
acbart commented 9 years ago

Hmm... You may need to pass in the scene explicitly - otherwise it tries to guess the scene by looking at the top of the director's stack, which hasn't finished being pushed to yet. But if I'm reading htings correctly, that's all happening behind the API calls? Need to dig in further...