proxximo Posted June 3, 2013 Share Posted June 3, 2013 Hi there, I am the creator of a php, text based game. Recently we have gotten a composer to create some really great music for us, however with the game being set up as it currently is, that is to say click - page change, adding music is a little tricky. The advice I need is a solution for adding music that doesnt interrupt when the page changes. My first thought was to run the game in an iframe and have the music being played at html top level, but I am unsure if this is the best route to take, mostly because I would like to be able to change the music depending on what is happening in game (i.e. combat, visiting town, exploring, etc.) I was hoping to get some input before I move ahead with any solution. Does anyone know of a solution that would take cre of the following. -Does not interrupt the music when the page changes, as the scripts run constantly, changing the page to tell what your character is up to. -Can change the music from the php game -Keeps the interface clean Thanks a ton for your help guys and gals! If any more information is needed, I would be glad to give it. Proxximo Quote Link to comment https://forums.phpfreaks.com/topic/278722-php-game-need-advice-on-a-music-solution/ Share on other sites More sharing options...
Solution Philip Posted June 3, 2013 Solution Share Posted June 3, 2013 You can use JS to change the page. If you're running HTML5, you can use the History API to change the page, which should leave the music alone. There is an awesome library that helps support this that you can look at - https://github.com/browserstate/history.js Otherwise, I think an iFrame would be your best bet. Quote Link to comment https://forums.phpfreaks.com/topic/278722-php-game-need-advice-on-a-music-solution/#findComment-1433843 Share on other sites More sharing options...
proxximo Posted June 3, 2013 Author Share Posted June 3, 2013 Thanks for taking the time to respond Phailip. It is much appreiated! Quote Link to comment https://forums.phpfreaks.com/topic/278722-php-game-need-advice-on-a-music-solution/#findComment-1433846 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.