Search the Community

Showing results for tags 'stop'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Platform
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • 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'] =[i].name); To play the sound at the desired points of my code I just do: window['_snd'].play() // works fine However I am not managing to STOP the sound with: window['_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 =, 1, true); sounds =, 1, false); sounds =, 1, true); sounds =, 1, false); Now how I can check if sound2 is playing or pause/stop just sound4?
  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 ='background_music');; music.loopFull(0.3); music.volume = 0.3; and try to stop it in the Shutdown function with "music.stop();" You can also try it yourself HERE
  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 their momentum they can then proceed through them at the press of the movement key (or if thats even possible). I feel like its more likely that I'd be able to set a coordinate for movement to stop, but again I don't know if thats possible either. Any help would be appreciated!
  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); }, atk: function(){ this.atkBool = true; }, update(){ if ( && this.atkBool == true){ var anim ='atk'); } I want just 1 loop so stop animation after my "541" frames. Sorry for my english langage. I hope you can help me. Good day
  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 and navigate it.. So is there a way to control speed and stop mesh before there is a collision/intersection? Or is there a whole different better way to implement movement of that kind? Any advice, opinion and info welcome and thanks so much This is how code for one key press looks like: (sphere is the object we're trying to move - i have yet to import it but at least I know how to do that) window.addEventListener("keydown", function(evt) { if (evt.keyCode==87){//forward scene.registerBeforeRender(function () { sphere.computeWorldMatrix(true); //labyrinth.computeWorldMatrix(true); if (!sphere.intersectsMesh(labyrinth, true)) { //sphere.applyImpulse(new BABYLON.Vector3(premikanjeX, 0, premikanjeZ), sphere.position); var forward = new BABYLON.Vector3(parseFloat(Math.sin(parseFloat(sphere.rotation.y))) / 8, 0, parseFloat(Math.cos(parseFloat(sphere.rotation.y))) / 8); sphere.moveWithCollisions(forward); } });}}, false);
  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(){ },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 times" and so on... It's like it is reporting when each video has stopped, not just the video that has just been "source changed". Here's the code: window.played = 0; var game = new Phaser.Game(1280, 720, Phaser.AUTO, 'gameCanvas', { preload: preload, create: create}); function preload() {'Blank', 'vids/blank.mp4'); game.load.image('btn','gfx/btn_conoce.png'); } function create() { button = game.add.button(100, 400, 'btn', btnClick); video ='Blank'); video.addToWorld(0, 0, 0, 0, 0, 0); videoOnStop = new Phaser.Signal(); video.onComplete = videoOnStop;; videoOnStop.add(function() { played++; console.log("Video Stopped: Played " + played + " times"); }); } function btnClick() { video.changeSource('vids/anothervideo.mp4');; } Greets!
  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?

  11. Hello, I need to if item.x equal 100 then items cannot be drag. I added :, 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, it seems) Thanks!
  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 (, certainItem)) { var hit ='hit');; certainItem.kill(); player.body.velocity.x = 0; // Tried to stop, but I am still able to move him'hit'); // Changes to the frame I wanted but then quick //-ly changes back // this.gameOver(); }Thank you in advance.
  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() { game.load.image('player', 'assets/player.png');}function create() { player = game.add.sprite(400, 300, 'player'); player.anchor.setTo(0.5, 0.5);}function update() { if (game.physics.collide(player, { player.velocity.x = 0; player.velocity.y = 0; } else { player.rotation = game.physics.moveToPointer(player, 60,; }}Thanks!