-2

I am working on the project below initially stages animation works fine but after 2nd level the Frame rate drops drastically, below is the link of the game can anyone look into and help me, please!

http://fbapps.ae/mfc/game-demo/

thanks mustafa

1 Answers1

0

Currently can not get passed level 1. The _animalClicked method shows that the _questions variable is undefined, so you get wrong answers indefinitely.

I would say if you can in fact get past this, and are seeing a frame drop, then it is likely your not properly cleaning up your stage or events.

A few other notes:

Get rid of all the stage.update() calls you have everywhere. Once you call handleComplete, you no longer need to update the stage, because there is a Ticker event which updates the stage constantly. You might want to consider just adding a ticker event initially, rather than waiting for the content to load.

Note that removeEventListener can not be called with no handler argument. Unlike jQuery, this does not mean "remove all events of this type". You are using anonymous handlers, so you will have to hang on to a reference to that function, and pass it to removeEventListener instead. Alternatively, you could use removeAllEventListeners(). Looks like you do that elsewhere.

Lanny
  • 11,244
  • 1
  • 22
  • 30
  • Thanks Lanny! for your quick response...this is really helpful. Now i have remove all unnecessary stage.update() and i double check on all eventlistner but i don't see anything which can be removed. On desktop somehow it works fine, but on ipad and mobile(specially on android) it just drop drastically..and even desktop while displaying right/wrong answer framerate goes down...it goes upto 25 from 38/40. I already update this link again http://fbapps.ae/mfc/game-demo/ – user2374496 Sep 15 '16 at 06:28