You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GameScreen is potentially a not-so-great place to set up the renderer and camera.
For starters, as rendering gets more sophisticated (for instance, if we begin to use multiple render passes), the WorldHandler will need to dip in to the GameScreen to interact with the renderer, or vice versa.
Additionally, at present, the initialization of WorldHandler begins loading a map-- prior to logging in or otherwise starting to interact with the game. It'd be better if the world didn't begin to load at least until the game screen is selected from the screen dropdown.
An alternative approach to this is outlined below.
Progress
Create a new WorldRenderer class
Responsible for: managing THREE.WebGLRenderer and render passes; managing world camera(s); updating the renderer in response to resize events; managing the RequestAnimationFrame loop
Update GameScreen to no longer handle the camera, renderer, or the animation loop
These aspects of rendering would instead be managed by WorldRenderer.
Stop worldport'ing the player on construction of WorldHandler
Instead, wait until GameScreen mounts to do the worldport. Eventually, worldport should only happen after character selection.
Stop loading player model when Wowser loads
Instead, wait until GameScreen mounts to do the model load. Eventually, player model loading should only happen after character selection.
The text was updated successfully, but these errors were encountered:
GameScreen
is potentially a not-so-great place to set up the renderer and camera.For starters, as rendering gets more sophisticated (for instance, if we begin to use multiple render passes), the
WorldHandler
will need to dip in to theGameScreen
to interact with the renderer, or vice versa.Additionally, at present, the initialization of
WorldHandler
begins loading a map-- prior to logging in or otherwise starting to interact with the game. It'd be better if the world didn't begin to load at least until the game screen is selected from the screen dropdown.An alternative approach to this is outlined below.
Progress
WorldRenderer
classResponsible for: managing
THREE.WebGLRenderer
and render passes; managing world camera(s); updating the renderer in response to resize events; managing theRequestAnimationFrame
loopGameScreen
to no longer handle the camera, renderer, or the animation loopThese aspects of rendering would instead be managed by
WorldRenderer
.WorldHandler
Instead, wait until
GameScreen
mounts to do the worldport. Eventually, worldport should only happen after character selection.Instead, wait until
GameScreen
mounts to do the model load. Eventually, player model loading should only happen after character selection.The text was updated successfully, but these errors were encountered: