Who listens?

Something has bugged me for quite a while: Aural Fighter reacted slower and slower the longer I played it. I was absolutely sure it had to do with the rendering code, but even a bare-bone test game slowed down after a while. Confused, I ignored the issue for a while, but I realized I couldn’t release Aural Fighter with such an issue unresolved, so I just had to fix it.

But whatever I tried, nothing seemed to cause the problem. Finally, I decided to create a minimum piece of code that still reproduced the problem, to post on the HaXe mailing list. While doing so, I found out that the game only stopped respondeding after a lot of keypress events had happened, not just after some time. I was confused: was I handling input in a wrong way? It should be a perfectly normal method… but while stripping away unrelevant code, I finally figured it out: I had added another keyListener in a pre-loader frame, one that was never removed afterwards. This one started to intervene with the other keyListener. Removing it finally solved the problem.

On a side-note, I’ve added shadows to all enemy fighters and I’ve drawn a few new enemies and tiles. I’m also working on another game – as a school project – so Aural Fighter is proceeding slower as desired, but the experience I gain from that project should be pretty usefull for later games. I’ll write some more about that project later.

Who listens?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s