Jump to content


  • Content Count

  • Joined

  • Last visited

About CtlAltDel

  • Rank
    Advanced Member

Recent Profile Visitors

1821 profile views
  1. What do you mean what logic? The physics are the same server and client, homebrew collision detection. Polygon vs circle. Circle being the player. So the client runs the same simulation as the server. It's based on the articles valve wrote about counterstrike.
  2. At the top of getQuestion do: var self = this; and then use self.sendQuestion(result); inside the onload. Read up on scoping in javascript
  3. Client and server should both run the same simulation. Server is authorative, so it sends the results of it's simulation including the point in time where that was and the client predicts from there again running the sim. I am not sure if p2 is suited for this. For my own multilplayer tech demo I wrote my own simple 'physics' it's a topdown shooter so basically only collisions with walls mattered and how they affect the character movement.
  4. This series explains it all http://www.gabrielgambetta.com/fast_paced_multiplayer.html
  5. What you need is: http://gamedevelopment.tutsplus.com/tutorials/understanding-steering-behaviors-seek--gamedev-849
  6. I would suggest treating PIXI as a render engine, and keep data related to your game objects ( =/= display) in your game objects. I see no need for extending with custom attributes. But that's just me. Separation of concerns.
  7. http://phaser.io/examples/v2/groups/create-sprite-in-a-group so it should work.
  8. I think you should use a rendertexture to accomplish that. Render to that texture and dump the contents of that.
  9. read: http://phaser.io/examples/v2/input/keyboard-justpressed for a lot of options
  10. It's looking up the next invisible sprite that might be costly if you have a lot of sprites.
  11. It is probably faster to use 2 pools, 1 visible and 1 invisible if you have lots of sprites, then you can just pop one from the invisible list and add it to the visible list. Keep in mind this requires you to toggle the visible flag via a helper function that does the moving of sprite between pools.
  12. Your create functions each foreach and in that again each foreach. Maybe define those functions outside the loop and call them instead of using anonymous functions. You also create an array [en] inside the foreach. You might want to do have one array this.hitTestArray and just this.hitTestArray[0] = en, and pass this.hitTestArray to the p2 check. Both might account for some garbage.
  • Create New...