Best practices on separating Update and Draw on game loop
Posted
by
Galvanize
on Game Development
See other posts from Game Development
or by Galvanize
Published on 2012-10-08T12:42:02Z
Indexed on
2012/10/08
15:54 UTC
Read the original article
Hit count: 250
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.
© Game Development or respective owner