David Geary: HTML5 2D game development: Implementing Sprite behaviors