cykod / Quintus

HTML5 Game Engine
http://html5quintus.com
GNU General Public License v2.0
1.41k stars 401 forks source link

Cannot read property 'rate' of undefined #185

Closed xman51 closed 8 years ago

xman51 commented 8 years ago

I am trying to load animations and seem to have all the properties set in order to do this according to the instructions, however I keep getting the error:

quintus_anim.js:34 Uncaught TypeError: Cannot read property 'rate' of undefined

in the console, it is the variable 'anim' that is undefined:

var anim = Q.animation(p.sprite,p.animation) p.sprite is defined as "Lisa_run" and p.animation is defined as "left".

Here is my code:

http://pastebin.com/wZQyzm1m

xman51 commented 8 years ago

Turns out my animation code was in the wrong place. Needs to be in the load block.