freezedev / lyria

Lightweight DOM-based game framework
The Unlicense
8 stars 0 forks source link

Improve Preloader #7

Closed frostney closed 9 years ago

frostney commented 11 years ago

Use a dual-system preloader first, which loads images and scenes first and audio afterwards. Audio data should not block the usual loading process. Inspired by http://northwaygames.com/?p=372

frostney commented 10 years ago

Re-thinking this, I think it would be more fitting to give certain tasks priorities and a flag if the complete event should be triggered if those tasks with a certain priority are finished.

Polooo2 commented 10 years ago

Splashscreen support would be nice in the preloader

Am 21.12.2013 10:59 schrieb Johannes Stein notifications@github.com: Re-thinking this, I think it would be more fitting to give certain tasks priorities and a flag if the complete event should be triggered if those tasks with a certain priority are finished.


Reply to this email directly or view it on GitHub: https://github.com/freezedev/lyria/issues/7#issuecomment-31060337

frostney commented 10 years ago

Splash screens are already possible, you can define a scene that is visible during the entire loading process with Preloader.loadingScene if a scene director has been defined through Preloader.sceneDirector. (The latter is done automatically if the lyria game instance is used.)

Polooo2 commented 10 years ago

Can I define multiple screens, e.g. company logo than game logo?

Am 21.12.2013 11:31 schrieb Johannes Stein notifications@github.com: Splash screens are already possible, you can define a scene that is visible during the entire loading process with Preloader.loadingScene if a scene director has been defined through Preloader.sceneDirector. (The latter is done automatically, the lyria game instance is used.)


Reply to this email directly or view it on GitHub: https://github.com/freezedev/lyria/issues/7#issuecomment-31060725

frostney commented 10 years ago

Well, there are two ways to achieve this:

  1. The easy way: Define a loading scene, each of the images are divs and hidden by default. Listen to the progress event from the preloader and switch the images to visible depending on the progress.
  2. The harder way: define a loading scene, add a different scene director to the loading scene. The scene director from the loading scene has the company logo scene and all other necessary scenes added to it. Listen to the progress event in the loading scene and show the appropriate sub scene depending on the progress.
frostney commented 9 years ago

Preloader with tasks are already possible. Not sure why I didn't close the issue earlier.