Author Topic: FlxG.keys.pressed cause the low FPS  (Read 1663 times)

skyboy999

  • Member
  • **
  • Posts: 6
  • Karma: +0/-0
    • View Profile
FlxG.keys.pressed cause the low FPS
« on: Wed, Oct 9, 2013 »
In my update() method I check pressed space button and then my character jump. But if I hold on space button for a multiple seconds my FPS goes down. For instance, I have 55fps, but when I hold on space button I get 30-35fps. How to prevent it?

Minverva

  • Active Member
  • ***
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: FlxG.keys.pressed cause the low FPS
« Reply #1 on: Wed, Oct 9, 2013 »
Let's see the code.

Change it to justPressed if you can.

skyboy999

  • Member
  • **
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: FlxG.keys.pressed cause the low FPS
« Reply #2 on: Thu, Oct 10, 2013 »
Let's see the code.

Change it to justPressed if you can.

Ssory it's my fault. I exported swf in release mode and fps became normal.

Minverva

  • Active Member
  • ***
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: FlxG.keys.pressed cause the low FPS
« Reply #3 on: Thu, Oct 10, 2013 »
Ssory it's my fault. I exported swf in release mode and fps became normal.

I think that's rather odd. I wonder why that is?

GeoKureli

  • Member
  • **
  • Posts: 34
  • Karma: +0/-0
    • View Profile
Re: FlxG.keys.pressed cause the low FPS
« Reply #4 on: Fri, Oct 11, 2013 »
Are you tracing a bunch of stuff on your update loop?