Jump to content

Search the Community

Showing results for tags 'stop'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 16 results

  1. I have an array with a list of sounds and then I loop barely like this to add them to the game: for (var i=0;i<=aSounds.length-1;i++) window[aSounds[i].name+'_snd'] = game.add.audio(aSounds[i].name); To play the sound at the desired points of my code I just do: window[me.name+'_snd'].play() // works fine However I am not managing to STOP the sound with: window[me.name+'_snd'].stop(); // instead to stop the sound it just restarts What am I doing wrong? Thanks!
  2. Good morning! I've a related sounds question. I would like to manage all my sounds in just one Phaser sound object, when i want to start playing one or more sounds, it all works properly but, when I have to check if one specific sound is playing, or if I want to pause/stop one specific sound I don't get how to do that. Example: let sounds: Phaser.Sound = null; sounds = game.sound.play(sound1, 1, true); sounds = game.sound.play(sound2, 1, false); sounds = game.sound.play(sound3, 1, true); sounds = game.sound.play(sound4, 1, false); Now how I can check if sound2 is playing
  3. Hello, I've got an issue stopping audio on Firefox. On Chrome ore Edge stopping the Sound works fine but Firefox won't stop the sound and if you start the Sound again it'll play twice. The main intention was to stop the sound when the state shuts down but it doesn't work when I bind the command to a key aswell. It's really annoying and I couldn't find a fix anywhere. I start the sound in the Create function with music = game.add.audio('background_music'); music.play(); music.loopFull(0.3); music.volume = 0.3; and try to stop it in the Shutdown function with "musi
  4. I'm still new to Phaser and coding in general so I apologize if this doesn't make sense. I have player gravity and bounce set to 0 and movement velocity cranked up so movement seems instant. I'm looking to make it so that once the player hits a certain point on the x axis it stops, then the movement key must be pressed again to continue in either direction until it hits another one of those points, and so on. One idea I had was to populate the screen with vertical immovable bars with collision spread out evenly, but I don't know how to make it so that once the player hits them and stops
  5. hello, I need your help guy, i would create an animation with my character. When i push left click (mouse), the animation start but she is infinite. How stop my animation? my code: create: function() { this.player.animations.add('atk', [529, 532, 535, 538, 541], 10); this.game.input.onDown.add(this.atk, this); }, atk: function(){ this.atkBool = true; }, update(){ if (this.game.input.onDown && this.atkBool == true){ var anim = this.player.animations.play('atk'); } I want just 1 loop so st
  6. Hi! I'm new to this so this is probably a dumb question.. Been trying to make a game where object moves through labyrinth without going through walls. I implemented collision detection to the point where I'm sure its working but when I tried to move it with .position method there was no collision happening so I ended up using the moveWithCollisions method. This works but once you press the button the object starts moving and doesn't ever stop it just changes direction at another key press. It also increases speed and both of this thing make it very useful to move it through gaps in the walls a
  7. hi, i'm searching to use the delay of a tween and also have the possibility to cancel this tween. But that don't work, the tween is still here and the lock function works... have you an idea ? this.tween=game.add.tween(background.cursor_player.scale).to({x:3},850,Phaser.Easing.Bounce.In,true,0) this.tween.onComplete.add(this.lock,this) this.lock=function(){ } game.time.events.add(100,this.tween(stop),this)
  8. Hi, I'm having a problem (it looks like a bug) with phaser.signal detecting when a video has ended when using changeSource function. I'm using phaser 2.4.8 (but it also happened with 2.4.6). To reproduce the issue, please change both videos and the image button with some media you have. Once you run the demo, check your developer console each time button is pressed. The first time the video is stopped, it says "Played 1 times" The second time it says "Played 2 times" AND "Played 3 times" The third time it says "Played 4 times", "Played 5 times" AND "Played 6 t
  9. Hi there, I'm back Is there a way to detect if a mesh has animations playing and cancel them? I'm using the following code to animate the emissive color of my meshes on mouse over, but it doesn't seem to be pushing the animation to mesh.animations: BABYLON.Animation.CreateAndStartAnimation('fadingIn', objectUnderPointer, "material.emissiveColor", 30, 10, objectUnderPointer.material.emissiveColor, fullEmissive, 0); Also the Animation class doesn't seem to have a stop method so I'm not sure where to go from there. Thanks!
  10. rmbennin

    Stop Update?

    Hello all, I am trying to basically stop my Phaser game completely, the main thing is getting it to stop "updating". I'm not sure how to do this. This is my code creating the game: game = new Phaser.Game(1000, 600, Phaser.AUTO, "gameCanv", { preload: preload, create: create, update: update, quitGame: quitGame } ); In the quitGame function, I am trying to stop the game from running, so I can see if the user got a high score, update the scoreboard for it, and ask the user if they want to play again with different conditions. I have this co
  11. Hello, I need to if item.x equal 100 then items cannot be drag. I added : currentsprite.events.onDragStop.add(mouseDragEnd, this); function mouseDragEnd(item, pointer) { if(item.x == 100) item.stopDrag(); } But there is not working. Did anyone help me = ) ? Thanks. Alper
  12. Hello again! I was trying to use a lot of tweens in some scenes of my game, and I wasn't able to find a way to stop the tweens. I've tried to set a flag to false to stop it from ending, But I found out the hard way that they wasn't actually stopping. When I started another tween, my object's coordinates were messed up because of the previous interruption of tweens. Is there a way to stop a tween in a way that it REALLY stops? I'd be very grateful if someone could answer this to me. (PS.: I've already found three other posts about it, but their solution (myTween.stop() doesn't work anymore,
  13. Hello, I was wondering how can I immediately stop a tween from keep updating once the associated object is killed or removed. Is there an official way to do this? I know I could keep a reference of the tween in an array or variable but I have over 20 tweens simultaneously updating and I wouldn't want to keep iterating an array just to find one tween in order to stop it. Thanks!
  14. I would like it so that when a certain event happens, the player completely stops moving (for a few seconds or so), the user does not have the ability to move at all, and I am then able to proceed to call a function (which calls a function to end the game). How would I implement this? Here is a snippet of code located in my Update function: (Please note: I am using the Phaser basic template, so when calling functions and methods, we must use 'this'. if (this.game.physics.collide(player, certainItem)) { var hit = this.game.add.audio('hit'); hit.play();
  15. Hello everyone, I started using Phaser today and I must say I am impressed. Well done guys! I made a simple image rotate and move towards the mouse, as explained in the examples "accelerate to pointer" and "move towards object". What happens though is that when that image collides with the mouse (meaning image coordinates = mouse coordinates) the image stops and starts trembling awkwardly. Any way to make it stop facing the last position before colliding? My code: var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });function preload(
  16. I'm going to build a cool animated game, simple mechanics and few game objects (around limit of 50) without counting particle effects if any. The main goal a want to succeed is to make smooth animation. All animation is going to be sprite/frame based, and still a lot of games use 3 to 4 frames for animating a character running left, or top My main question is when frames are too many... If i make 10 frame for walking left, 10 frame for walking to top, then 10 frames for walking to bottom, and 10 frame for a idle animation: Then I've got to have 40 frames of character for the most bas
  • Create New...