A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Basic game framework

  1. #1
    Developer
    Join Date
    Sep 2011
    Location
    Allentown, PA
    Posts
    3

    Basic game framework

    I'm making a shooter game and I'm trying to to optimize the code as much as possible because at the 2nd level, where there are lots of astroids, the game totally bogs down on my Android.

    Basically, I have an Engine object connected to the main stage itself that runs everything. Once the game starts, it starts reading in the level array and displaying the enemies at the correct time - at the the top of the screen.

    Each enemy is an object, most enemies can fire - more objects.

    The player can move, fire multiple weapons, etc.

    The game just BOGS down with more than 30+ items on the screen simultaneously...

    Am I using the right structure? Anything I can do to optimize the game?

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    You should try to find out if slowdown is caused by code execution or drawing items on screen. One possible way would be running exactly same code but remove all the graphics, if you use frames and timelines just delete all the graphics so only empty frames remain.

    If code runs slowly, try to spot part of code which takes most time and optimise it.

    In the end, it is still possible your hardware and Android compination simply is not capable to run Flash content faster.

  3. #3
    Junior Member
    Join Date
    Nov 2011
    Posts
    1
    Well guys the idea of this game is very good but there is need of complete settings and if the code execution works very favorably than it is to consider that it is a good fighting game.

  4. #4
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    The game may lag if the arrays are too large. To find out what is happening it is recommended that you post the game code.
    <signature removed by admin>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center