Jump to content

Search the Community

Showing results for tags 'async'.

  • 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
  • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 8 results

  1. This is my async.forEachSeries function: async.forEachSeries(parsed.moves,function(move, callback) { that.moveObj(move, callback) }, function() { console.log('done running the entire code') }); Move object is starting the tween and calling the callback onComplete of the tween. moveObject(x, y, obj,callbackToAsync, offsetX = 0, offsetY = 0) { let coordinates = this.convert(obj.i + offsetX,obj.j + offsetY) let tween = this.game.add.tween(obj, this.game, this.game.tweens).to({ x: coordinates.x, y: coordinates.y }, 2
  2. Code: https://pastebin.com/zE0zhn7K So if you try to load a scene asynchronously, do something else, start the engine using that scene, The scene will just show an empty space. However, if you take a look at the code above, go to async function createScene(config) { const { textureModifier } = config; const { height, width, color } = config; const scene = new Scene(config.engine); await importScene(config.mesh, scene); And comment 'importScene' line, the go to async function run() { // await importScene(config.mesh, scene.internal); engine.runRender
  3. Just a quick question; how to not freeze the render loop when doing "heavy" operations? Example: In my game, I have a stage that is composed of squares. The player can move around the stage but so can the enemies. The enemies are using a pathfinding system that uses navigation mesh. This navigation mesh is created dynamically when the game runs. Player can destroy the tiles of the stage. The tile destruction triggers the recalculation of the navmesh. The recalculation itself is a pretty heavy operation that freezes the whole game for a second or so. What I'm pretty much asking is
  4. Hi, To make the preload faster, I need to load several assets after the preload phase, and use then when they has been loaded. To do that, I've used the Phaser.Loader object and register to "onFileComplete" Phaser.Signal to catch the file when has been loaded, to load the next file. This works well until I need to change the current state and there are an asset being loaded. When the file is loaded and the new state has been created, Phaser detects that the Loader is not loading (processLoadQueue method from Phaser.loader) and shows this message: 'Phaser.Loader - active loading canc
  5. Hey guys! I am coding simple roguelike dungeon crawler: Live version. I have this issue with collisions, whenever a player is positioned like this: ( the lighter tiles are floor tiles and the darker walls obviously ) When he presses down arrow and left arrow at once, he can move on wall tile. This is how I handle input: onKeyDown( event ){ switch ( event.key ){ case 'ArrowUp': this.nextStep( 0, -1 ); break; case 'ArrowDown': this.nextStep( 0, 1 ); break; case 'ArrowLeft': this.nextStep( -1, 0 ); break; case 'ArrowRight': this.nextSte
  6. I'm building my first Phaser game and stumbled upon a conceptual issue I'm not sure how to solve best. Sometimes I want to wait for a tween to finish before I run the next bit, e.g. in a match 3 game I'd want to remove the matched blocks before dropping the rest and so on. Here's a snippet to illustrate how I've found it done in simple examples. function removeBlocks() { var duration = 1000; game.add.tween(...).to(..., duration, ...).onComplete(...); ...}function dropBlocks() { ...}removeBlocks();game.time.events.add(1000, dropBlocks);This works but there's an implicit dependency between
  7. Hey guys, I have just got adverts working in my game, however I have an issue with loading the ad. When I call this function fullscreen1 = CocoonJS.Ad.createFullscreen(fullscreen1Params);It will lock up/lag my game until it fetches the ad. I want to do this asynchronously but I don't know how to tackle this using pure javascript (I am not using a framework that has this built in). Does anyone have tips for how they bypassed this issue? I am tempted to just wait until the complete callback is called however if the ad fails to load then the game will never start. Is there a simple way arou
  8. Hi guys, I need some general advices regarding building a turn-based multiplayer game using HTML5 that runs of Facebook. It would be my first multiplayer game, so please be kind with me It's a sort of "quiz-game" in which you: 1. select a Facebook friend to challenge and 2. answer 3 different questions Then, when the other player has completed his turn, the game will choose the winner. I believe that the server logic it's very simple because it only has to 1. calculate the players' scores on each answer 2. check who's the winner 3. post the scores to a database to build a leader boa
×
×
  • Create New...