precache.js 396 B

1234567891011121314151617181920
  1. var resources = {
  2. "Sprites/space_background.png" : "Texture2D",
  3. "Music/battle.ogg" : "Sound"
  4. }
  5. // precache resources so they are ready to go
  6. exports.precache = function(verbose) {
  7. var game = Atomic.game;
  8. Object.keys(resources).forEach(function(key) {
  9. game.cache.getResource(resources[key], key);
  10. if (verbose)
  11. print("Precaching: ", resources[key], " ", key);
  12. });
  13. }