pensivepixel / Cat-Video-Game

0 stars 0 forks source link

Rework the canvas infrastructure. #2

Open pensivepixel opened 4 years ago

pensivepixel commented 4 years ago
pensivepixel commented 4 years ago
  • Create new object for the on-screen Canvas for final rendering

Not sure if it's a good idea to maintain separate OSCs just to squish them all down to one on-screen Canvas. The idea behind having separate layers is so we don't have to redraw the whole thing every frame.

pensivepixel commented 4 years ago

Better solution could be to:

pensivepixel commented 4 years ago

Under this better solution, we need to add a stage for repaint boolean value for each layer. Even animation layer needs this because we will want to control the speed of the animation over time, which means we won't necessarily be repainting the animation canvases every single frame.

pensivepixel commented 4 years ago

Need to rename the "foreground" and "background" layers to "staticSprites" and "dynamicSprites."