• Content Count

  • Joined

  • Last visited

  1. So to pause im using music.pause(); But is there a way to a pause for say 3 seconds, and then the music resuming?
  2. So I have different audio samples for each different collision, and I load them into the game as follows: music ='hurt',1); music2 ='boom',1); music3 ='bird',1); music4 ='landing',1); music5 ='fail',1); And then I call the sound at the different parts of the game as follows:; This has worked fine up untill the last music5. It comes out distorted. Have I got too many sound files? Each audio sample is only a second or 2 long. Any additional sounds I use past music4 are distorted.
  3. I have been playing around with this example trying to edit it so the sound plays when The spacebar is pressed, but cant seem to figure it out. Anyone help me with this?
  4. In the game im making, I have 2 separate html files, a level 1 and a level 2. Once I complete level 1 I want it to run level 2. Once the level is completed an image pops up says that the level is completed. I want the next level to load when the user clicks on this image. How would I go about this? This is the code I have. function rightAnswer (num1, ground1) { wellDone = game.add.sprite(200,100, 'wellDone'); score += 1; scoreText.text = scoreString + score; num1.kill(); ship.kill(); cloud.kill(); game.state.start('level2', AirQuation.level2); }
  5. Yeah I have been trying that out with no luck. How would I edit that code so that it plays the sound when the space bar is pressed?
  6. This is a group of sprites , I want the num1 sprite to free fall from the ship when The spacebar is pressed. ufo =; xray = ufo.create(732, 210, 'xray'); ship = ufo.create(700, 175, 'sprite'); num1 = ufo.create(718, 290, 'number1'); else if (dropButton.isDown){ //Move down num1.body.velocity.y = 900; xray.destroy; } When the drop button is pressed the sprite moves down the screen and is still connected to the ship. But what I want is for the sprite to free fall. Is there any documentation I can look at regarding this? Any working examples of a sprite in free fall after a button event?
  7. I want to add in a sound every time the space bar button is pressed. Any working examples of this?
  8. I have a helicopter sprite and I want the wind to slightly blow my sprite either left or right. And idea on how to do this?