Comment

Comment by AnimalMuppet

I'm not sure that this works in more general cases, though.

If I have a more general game with more objects of more types in it, adding each type to the render function is going to get old. In object oriented programming, I'd just call render() on each entry in the list of game objects. But this approach is going to lead me to:

- render each entry in the list of Foo objects

- render each entry in the list of Bar objects

- render each entry in the list of Baz objects

- ...

which doesn't seem to me to work out very well as the game grows more complicated.

(Sorry about all the line breaks - I can't seem to figure out how to get HN to display it right without them.)

parent AnimalMuppet 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton