Search the Community

Showing results for tags 'timers'.

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 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 5 results

  1. Hello, So I am working on my game: and it works pretty well, but I wanted to add some features to it. Mainly, I wanted to add powerups to help keep things interesting. Anyway, while I was doing so, all the sudden I noticed my code got super messed up. No console errors pop up, but my game will just stop spawning blocks after you get a power-up. In my original game, the only timer was the one that controlled when new blocks should be created. However, when I added another timer to stop the powerups (simply changing a variable back to its original state) it seems like the timer that controls the creation of new blocks stops working. Here is some sample code createPackets: function(){ //creating the square/packets...*1.15),function(){ this.createPackets(); //recursive function. Worked fine before },this); } //other code and stuff //on collision if(daBlock.type == "slow"){ //if the box is a slowing powerup this.speedModifier = currentSettings.powerups.slow.amount; //set speed mofifier, function(){ console.log("stop slow powerup"); this.speedModifier = 1; },this); } //when I remove the second timer everything works fine, but otherwise the packets/boxes/squares stop getting created after getting a powerup
  2. Hello all, Just release a script for creating a typewriter effect, using Phaser timers, and also able to mix sound in there as the typewriter is animating. Check out the source here: Or an example here: Let me know if you come across any issues or if you want something added.
  3. Hi guys! I just want to share with you some plugins i made for my games (pixi.js >= 3.0.8). May be useful for someone. pixi-animationloop: To manage the requestAnimationFrame, doing the basic time operations, like delta time, total times, stop the loop when the browser's tab lost the focus, etc... pixi-keyboard: To manage keyboard events easily. pixi-timer: To create time events, clocks, etc... pixi-audio: To add audio support using the pixi resource-loader. The plugin use webaudio by default, and fallbacks to HTMLAudio when is needed. pixi-tween: To create tween animations, tween alongs paths, etc... Extra: obj-pool this plugin is not for pixi.js per se, but it's useful when we develop games for the memory management. Extra2: ES6-Webpack-Pixi-bolierplate, a start point to use pixi with ES6. I have other things in a old engine i made with pixi v2-3, and i will be move it to pixi v3-4 like plugins, for example, scene transitions, particle sys and tools, etc... -> Particle sys tool1, particle sys2 Regards!
  4. Hi there, Phaser is super great, but sometimes I get stuck for days in one little functionality I can't find good explanations in the examples. So this is the thing. Im trying to follow this flowchart where timers get instantiated using: this.timer_AreYouThere =; This happens in my Tutorial.js game state, a timer will play a sound that says: "Are you still there..?" every 15 seconds until you click something and the game asks you do something else, and then again the timer gets destroyed and reinstated again, but now it will play a different sound every 15 seconds, until the user makes the action is asked for. Also after 1 min of inactivity from the user the game goes back to MainMenu game state. The problem: Everything works great, but once I wait for the 1 minute timer to load the MainMenu state, and the user works its way back to the Tutorial state, and user waits for 15 seconds for the "are you still there" sound, and the user taps Key.ONE to interrupt that sound and continue the tutorial... everything starts overlapping, sounds from previous timers get triggered and the becomes a mess. I don't understand why this events keep happening even though I killed them when I switched the states before. Here the code Im really stuck trying to understand the Timers. BTW I have the sounds in a global scope array (Boot.js) Your help is really appreciated.
  5. I've only been using Phaser for a few weeks now so this may be a noob issue, but here's the skinny: My app is one that loads "pages" of interactive content in sequential order, with next/previous buttons at the bottom of the pages to take you to the next/previous page. A JSON file is read to get the list of assets to display on a given page, and also to control what events take place for the page and when they occur. The game currently has three states, that are all defined in the same JS file: "Preloader", "PagePlayer", and "PageSwitcher", with a custom callback to be executed when the page shuts down: game.state.add('preloader', Preloader);game.state.add('pageplayer', PagePlayer);game.state.add('pageswitcher', PageSwitcher);game.state.onShutDownCallback = "shutdown";game.state.start('preloader');After the Preloader state runs, it starts the PagePlayer state with the first page to display, which works perfectly fine, and any timed events that need to occur are set up with calls like: tTimer =, IBExecuteBehavior, this, pElementID, tBehaviorObj, tBehavior, tTargetElementID);and they trigger when they're supposed to. (NOTE: The IBExecuteBehavior function is in the 'global' JS area and not inside any given state.) When the user clicks the Next button, the 'shutdown' callback executes and stops all the currently running timers for the page (I'm managing the references to the timers in the IBActivitiesMgr object where pg is the current page number): if (Object.keys(IBActivitiesMgr[pg]['timers']).length > 0) { for (t = 0; t<Object.keys(IBActivitiesMgr[pg]['timers']).length; t++) { console.log("Stopping timer:" + t); tTimer = IBActivitiesMgr[pg]['timers'][t]; tTimer.destroy(); }}The console is showing that any timers for the page are destroyed properly, and then it switches to the PageSwitcher state (which does a few things) and then PageSwitcher starts PagePlayer again but with a different value for pg (so the next page's content is acquired and displayed). All that works fine - but here's the problem I'm having: any timers that get created by the PagePlayer state for any page other than the first one that runs will not trigger at the designated time - the statement executes properly without error, but the IBExecuteBehavior function is never triggered - it's like the timer is "swallowed' or that it's trying to execute the function, but in a different context. I know there have been reports about Timer issues - but can you see anything that I did wrong or that will fix this problem?