Possible improvements

Alien Attack is a pretty robust game at the moment; we highly recommend looking through the source code and becoming familiar with every aspect of it. Once you have a good understanding of most of the areas of the game, it is a lot easier to see where certain areas could be enhanced. Here are some ideas that could be added to improve the game:

  • Bullets could be created at the start of a level and stored in an object pool; so rather than creating and deleting bullets all the time they can be pulled from and put back into the object pool. The main advantage of this approach is that the creation and destruction of objects can be quite expensive when it comes to performance. Eliminating this while the game is running could give a real performance boost.
  • Collision detection could be optimized further, possibly through the addition of a Quadtree to stop unnecessary collision checks.
  • The source code has a few areas that use string comparisons to check types. This can be a bit of a performance hog, so other options such as using enums as types may be a better option.

You may have noticed areas yourself that you feel you could improve upon. Working on these within the context of a game, where you can test the results, is a great learning experience.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.158.134