JFrankfurt / To-The-Moon-Bitcoin-Game

A Bitcoin Faucet Game
7 stars 7 forks source link

MoonBase intro animation #4

Open JFrankfurt opened 9 years ago

JFrankfurt commented 9 years ago

We've got our intro video in mp4, but there doesn't appear to be an easy way to integrate this via Phaser's library (Nothing in docs). If there is, google searches up to now have not revealed how. ("phaser intro video mp4" tends to provide you with introduction to phaser videos, not how-to videos on giving your game an intro.)

Consider playing the video at game scale with html5 video element, then killing the DOM node after it's completed with JS and rendering the game's canvas element.

JFrankfurt commented 9 years ago

Messy solution mentioned above implemented.

There are two dom elements used here, an html5 video tag and a z-index=-1 black box to compensate for the fact that our video is not the same size as our game. Both are removed with a setTimeout() after 3.3 seconds.

Moved the audio to an html5 tag, which causes the music to start playing from the instant the page loads, instead of when the game loads.