Hi All!
I have followed a few Gideros tutorials, however generally "learn by doing". I use the 'game loop' (Event.ENTER_FRAME loop) to do 99% of my animation - say moving an object from left to right across the screen.
I am planning to dev for Android/iOS, but am currently working on my Win7 Box (3.2GHz, dual core, non-HT) .
With 2 static sprites and a black background i get small CPU use - about 10-20%. When i add a Event.ENTER_FRAME listener, to an empty function, the CPU sits at about 80%. Event.ENTER_FRAME is called on a custom class, extending Sprite.
Is this normal? Worried if a full X86 3.2GHz dual core CPU is using about 80%, that a phone may well...explode.
Thanks for any help!
Comments
That's not expected.
Can you show some code?
Likes: incipient
Using the example 'Bird Animation' produces the high CPU use.
If this should not happen (if it is a specific problem with my computer) then that is OK. I just wanted to make sure that using the 'Event.ENTER_FRAME' loop is the right thing to do.
If you have modified the example, it could be coming from your code.
Otherwise, it might be your computer however I can't see a reason why this would happen considering your machin specs.
Could be something else, instead.
Aren't you recreating functions or local vars in your onEnterFrame(), that kind of things?
about efficiency of Event.ENTER_FRAME well i use it for each and every kind of animation or movement i am even not using movieclip so yup Event.ENTER_FRAME is totally fine.
I also cannot see the results you are getting.
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
With the way Gideros is designed to work the EnterFrame listener is probably the *MOST* important function, it's where you do all the frame by frame game logic.
Are you sure you're not re-adding the enterframe listener each time creating some kind of enterframe feedback loop?
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill