Jump to content

Search the Community

Showing results for tags 'timers'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 5 results

  1. Hello, So I am working on my game: https://megabyterain.itch.io/firewall 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... game.time.events.add(800-(this.score*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 game.time.events.add(currentSettings.powerups.slow.time, 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: https://github.com/netgfx/Phaser-typewriter Or an example here: http://www.netgfx.com/trunk/games/tools/phaser-typewriter 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.game.time.create(false); 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 https://github.com/omarojo/Phaser-Test6/blob/master/scripts/Tutorial.js 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 = game.time.events.add(tDelayBefore, 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 game.time.events.add 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?
×
×
  • Create New...