BretzelPretzel
BretzelPretzel

Reputation: 119

performance slow on phone - flash air actionscript game

I'm a newbie, and I'm trying to make a game using Flash and Adobe AIR.

The game runs well on my computer so far when I test it out, but when I put it on my phone, it runs very slowly. I suppose I'm hoping to get some general tips for slow phone performance.

The game has a character in a vertical scrolling environment with objects to pick up that boost him upwards (similar to HyperJump).

Any common pitfalls for new developers that could drastically hurt performance?

Thanks in advance for the help! (sorry for not posting code...i'm really not sure what is slowing things down since it works so well on my computer)

Upvotes: 0

Views: 245

Answers (1)

user1888370
user1888370

Reputation:

Your computer has more gigs than your phone. The more memory you have, the faster it will run. To make your game run faster on your phone, you need to have less events and hitTest less times every frame, etc.

Most important would be to lower your frame rate. If your frameRate is too high, all events will call that number of times per second, and you would have a huge memory leak.

Put less animations. Every frame of animation is about 0.01 bytes.

In an array, don't add an event to the whole class. Simply put your events in the main timeline with the array, because the less events you have, the faster your game will be.

Put all similar events in one event. If you have multiple enter frame events, etc, then put them all in one place.

In mouseEvents, put all Buttons in one event. Simply check which it is by doing if(event.currentTarget == yourbtn) { etc. }

Hope this helped.

Upvotes: 1

Related Questions