Closed fractalbach closed 6 years ago
Separate the concept of WHEN you draw, from WHAT you draw...
For each Tile in VisibleTiles: Draw(Tile) For each {Object, Location} in Visible objects: Draw(Object) at (Location)
... And have separate functions for determining things like "which players are visible" and "what dynamic objects should be drawn on the screen"
https://github.com/fractalbach/TileExperiments/blob/2dcb0fecbc0331dbfa7772ba9faff26dd1fbc076/js/camera.js#L38-L47
Separate the concept of WHEN you draw, from WHAT you draw...
... And have separate functions for determining things like "which players are visible" and "what dynamic objects should be drawn on the screen"