upload my sketch on github.io but it loads forever

I tried to put a few of my project on my github.io to showcase to people. All of them runs on local host without any error and play smoothly.

But one of my sketch loads forever and never play. I doubted if it is the sound files which take too much space. I delete all the sound file but it still does not work. Then I really have no clue what is wrong out there. Could someone help me to take a look?

//with sound - https://berlinali.github.io/gamebot/ - https://github.com/BerlinaLI/berlinali.github.io/tree/master/gamebot

//without sound - https://berlinali.github.io/pcgamebot/ - https://github.com/BerlinaLI/berlinali.github.io/tree/master/pcgamebot

Answers

  • edited November 2016 Answer ✓

    errors on the web console for the sound version:

    Unable to load scoreSound.MP3. The request status was: 404 (Not Found)
     The error stack trace includes: 
    preload@https: //berlinali.github.io/gamebot/sketch.js:30:16
     p5.sound.js:944:13
    
    Unable to load hitSound.MP3. The request status was: 404 (Not Found)
     The error stack trace includes: 
    preload@https: //berlinali.github.io/gamebot/sketch.js:29:14
     p5.sound.js:944:13
    
    Unable to load winSound.MP3. The request status was: 404 (Not Found)
     The error stack trace includes: 
    preload@https: //berlinali.github.io/gamebot/sketch.js:31:14
     p5.sound.js:944:13
    
    Unable to load loseSound.MP3. The request status was: 404 (Not Found)
     The error stack trace includes: 
    preload@https: //berlinali.github.io/gamebot/sketch.js:32:15
    
  • (i've had to break the links to stop the forum formatting them badly)

  • Answer ✓

    You've got inconsistent file names. The sound files use extension ".mp3".
    However, you attempt to load them as ".MP3"! #-o

    function preload(){
     // bgdMusic = loadSound("bgdMusic.MP3");
      hitSound = loadSound("hitSound.MP3");
      scoreSound = loadSound("scoreSound.MP3");
      winSound = loadSound("winSound.MP3"); 
      loseSound = loadSound("loseSound.MP3");
      myFont = loadFont("acadeClassic.TTF");
    }
    

    My advise is to always use lowercase extensions. Even for your ".TTF" there! :-B

  • Thx guys. The mini game is up. berlinali.github.io/pcgamebot/ But the audioIn function is not available for ios and safari as they dont give access to mic control. So better use android or PC:)

  • @Berlina -- congrats on completing your game!

Sign In or Register to comment.