devbruce

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. devbruce

    Audio file can't be loaded

    Hey guys, when I try to load my audio file it doesn't work. That is what I do in my preload function: this.load.audio('theme', [ 'assets/Runn.wav', ]); That is how I try to use it in my create function: music = this.sound.add('theme'); music.play({ loop: true }); It worked, but as soon as I try to change the name of the key or the name of my audio file, it doesn't work anmyore and the following messages begin to appear: I get the following warning message: ' Audio cache entry missing: theme ' I also get the following error message: ' TypeError: this.currentConfig is undefined ' I hope you can help me with that. Thanks in advance.
  2. devbruce

    Collider for whole group

    Hey guys, im new to Phaser framework and I've got a problem. I try to put the stars from the tutorial on top of each other by doing this: stars = this.physics.add.group(); //this.physics.add.collider(player, stars, hitStars, null, this); this.physics.add.collider(stars,stars); this.physics.add.collider(stars, platforms); makeStars(); now if I do this the Stars fall in each other, only two Stars are on top of each other. If I change the order of the two colliders the Stars fall through the ground and still only two Stars stay on top of each other. This is my makeStars() function: function makeStars(){ if (this.stars) { this.stars.clear(true); } if (this.stars) { //stars.create(700, 497, 'star').body.velocity.x = 0; var numberofStars = randomNumber(1, 10); for (var i = 0; i < numberofStars; i++) { stars.create(700, -i * 50/*497*/, 'star').body.velocity.x = -150; } } } I really hope you can help me with this ! Thanks in advance