Skip to content

Instantly share code, notes, and snippets.

@jefBinomed
Created November 30, 2018 15:36
Show Gist options
  • Save jefBinomed/f42b30766465132d06252ece7bc3e6f4 to your computer and use it in GitHub Desktop.
Save jefBinomed/f42b30766465132d06252ece7bc3e6f4 to your computer and use it in GitHub Desktop.
2018-countdown-loads
// First I load the 'sprites'
loadSprites([
{title:'logos', url: 'imgs/logos.svg'},
{title:'spaceship', url: 'imgs/spaceship.png'}
]).then(function(){
// When the sprites are load, I start multiples 'intervals'
// One for the music
nextSong();
// One that display the grid, the space ship, ... (based on requestAnimationFrameRate)
runAnimation();
// One that move the logos (every 5 000 ms)
processMoveLogos();
// One that move the spaceship (every 500ms)
processMoveSpaceShip();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment