Skip to main content
Inspiring
September 26, 2018
Question

FPS Drop when click to stage

  • September 26, 2018
  • 1 reply
  • 282 views

I did one button that when user click to stage, the character execute one jump...

But, when the button is held down, the FPS from my APP is decreased.

Can someone help me?

Code:

stage.addEventListener(MouseEvent.CLICK, jump);

character.speedY = 0;

character.impulso = 5;

function jump (Event:MouseEvent) : void {

     character.speedY -= character.impulso;

}

There is an ENTER_FRAME that causes the character to always be pulled down:

character.y += character.speedY;

But my problem is only when the character does the jump animation, the FPS falls absurdly and then normalizes.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
September 26, 2018

that code does the same with a mousedown that it does with no mouse events.  (ie, click events don't execute on mousedown.)