Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Stupid, Clever, or Both?

Name: Anonymous 2007-10-24 2:02

I'm doing some expert programming of a tile-based game in which tile classes have references to anonymous functions that return the proper image for that tile. I figure I might as well not duplicate these. Should I make these functions onymous or just have a picture function manager that lets me get at them easily? It would be dead simple to create onymous functions for them at runtime, but it makes me feel funny to do it.

Name: Anonymous 2007-10-24 4:08

>>1
Implement some kind of resource broker, so that a function can say "I want this image", and the broker will reuse it if loaded, or load it if unloaded. The broker should also flush (unload) all resources when told so, which you would e.g. when moving to the next stage.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List