Hacker News new | ask | show | jobs
by calebmpeterson 5264 days ago
Wait... why wasn't the sprite responsible for rendering itself from the beginning?

  sprite.render(context);
or some such...
2 comments

Because that's roughly the worst way to render sprites, in terms of performance :)

You want sprites to be an array, and render that in one go.

ssssshhhhhhh

(contrived example for making a point... visiting a draw() method with a solid renderer interface is the answer we usually use)