jake

Members
  • Content Count

    6
  • Joined

  • Last visited

About jake

  • Rank
    Newbie

Profile Information

  • Gender
    Male

Recent Profile Visitors

355 profile views
  1. jake

    Game loop advice

    @Milton I actually went with the idea of choosing velocities that respect the minimum FPS value I want to target, in this case 60. The general rule I set for myself is to not allow velocities that result in less than 1 pixel of movement per 2 frames max. For example: velocity of 30 would be the min allowed speed resulting in 0.5 pixels per frame, or 1 pixel per 2 frames, basically 30 FPS. This has resulted in smooth(er) movement. Interpolation never really made a ton of sense in a pixel perfect loop in my opinion - and is a remnant of a brick breaker game I made using canvas primitives (not bitmaps) where it made sense - so I've rounded positions to whole values during rendering. The loop itself is fine, it's similar to Monogame where the update logic will try to catch up if dt is too far behind. Which can result in spiral of death but that's not a concern in my case. A live demo is here @Antriel thanks for the breakdown. I think the conclusion I came to with velocity selection makes sense based on what you suggested.
  2. jake

    Game loop advice

    Good point, I corrected this to be: bunny.pos.x += bunny.vel.x * (STEP / 1000) * bunny.dir.x; bunny.pos.y += bunny.vel.y * (STEP / 1000) * bunny.dir.y; Didn't stop the stuttering.
  3. jake

    Game loop advice

    I've been working on a base repo for pixel art games. The issue I've been running into is stutter when rendering sprites. Specifically I've seen this run buttery smooth on my laptop with a refresh rate of 144hz, but on 60hz monitors it seems to stutter. The game loop looks sensible to me, but I'm not sure what else to try at this point. Any help would be much appreciated. You can find the branch I'm working on here. The specific file of interest is game.ts. You can also see a live demo of it running on netlify.
  4. jake

    Tiled Map Sizes

    That's fair, I've mostly been experimenting with work from libGDX out of an interest for JavaScript. Thanks for your help Rich.
  5. jake

    Tiled Map Sizes

    Thanks Rich, this caused a noticeable performance increase for sure but still quite laggy. Any other suggestions?
  6. jake

    Tiled Map Sizes

    Hello everyone, So I've been testing out Phaser (I love the API btw) with a tiled map but I've been having performance issues. The map consists of 12 layers at 100 x 100 units (which are 16 x 16 pixels) and when traversing the map with the arrow keys it's quite slow. I don't know if I'm doing this optimally within Phaser so I'll just share code snippet I'm using. http://pastebin.com/QEd3ccr1 If there isn't issues with my code, could anyone tell me if Phaser would have problems handling maps this size or larger? Thanks.