Closed jshuaf closed 7 years ago
Maybe we can just switch to images -- but we should talk to designers about this @janisfuh
I think using html5 canvas might be a solution? it uses GPU to render (only if the calculation functions don't take too much effort to run for browser I think
That would work, but would require a major refactorization as we're currently rendering them as React components. It could get messy to try to coerce the DOM and canvas to work together.
yeah true lemme take a look first
Would it work if the boat is moving most of the time and the only time the river reflections need to move is when the boat is about to move off the screen, in which case this function is triggered?
So you want the boat to move instead of the river reflections?
@jshuaf Yeah that makes it a lot easier computationally?
hm... it would change the feel of the game a lot. you'd have to deal with a camera
@jshuaf let's talk over this at the meeting
Okay, so basically we have a problem with these river reflections. The current implementation is killing the CPU and freezing the game very quickly (see #78), so I've disabled them for now.
The current implementation of river reflections (pseudocode):
Basically having to iterate over the whole list of river reflection groups every time and perform some calculations... not to mention dispatching functions that will respectively iterate over the list AGAIN in order to either
So... this obviously can't all happen in the 16ms we get in
requestAnimationFrame