Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
that code does the same with a mousedown that it does with no mouse events. (ie, click events don't execute on mousedown.)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now