Jump to content

Search the Community

Showing results for tags 'play()'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hello everyone, sorry if this topic was discussed already, I couldn't find anything about it on the forum. I am relatively new to javascript and phaser, a hand would be great: I am trying to create a "music game" and I am looking for the best solution to play markers continuously from an audio file. here is part of my code: function onCreate() { console.log("onCreate") music = game.add.audio('music'); music.allowMultiple = false; music.addMarker('lvl1_1',0,1); music.addMarker('lvl1_2',1,1); music.addMarker('lvl1_3',2,1); music.addMarker('lvl1_4',3,1); music.addMarker('lvl1_5',4,1); music.addMarker('lvl1_6',5,1); music.addMarker('lvl1_7',6,1); music.addMarker('lvl1_8',7,1); music.addMarker('lvl1_9',8,1);[...]function playclicked(){ for (var i = 1; i <= maxvalue; i++){ music.play("lvl"+level.number+"_"+i); while(music.isPlaying){console.log(music.isPlaying);} } } in few words, the loop should be able to play the first marker, wait for it to complete and then play the next marker, and so on. The while loop won't get past the !music.isPlaying condition, maybe I am doing something wrong there..? The loop should also be clean enough to make the markers transition smooth, cause I am playing a song. also I am using game.load.audio(...) and not game.load.audiosprite(...) ; I previously used an audiosprite with json but I am not sure how to call out properties such isPlaying while working with it.. if someone could be so kind to explain how that works, I'd appreciate! thank you very much!!
×
×
  • Create New...