Best practices on separating Update and Draw on game loop
- by Galvanize
I've been working on my first HTML5 prototype and I found a good model that uses the regular Update and Draw loop we see in game dev. My question is, where does one end and the other begins?
The question popped when I wanted to rotate and draw an Image, and I kept wondering if the work of changing the tranformation matrix (that I presume would be a bit expensive since it works on the whole pixel array of an image) and calculating the right position do draw it would characterize drawing work, or maybe not, since after that I may need to check for collision or something similar.
Thinkig of it, seems like a silly question, but I would like some advice from more experienced developers. Where does does update ends and draw starts?
Thanks in advance.