A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Basic Flash Game Methodology

  1. #1
    Junior Member
    Join Date
    Jun 2001
    Posts
    4
    I've created a relatively simple maze game and I'm having a problem running it on slower machines. Anything less than a 400mhz processor, and the game runs like a turtle.

    Here is the basic programming methodology that I've used. Take a look and let me know if you thinkt there are any ways I can streamline the code to speed things up. Basically, what I want to know is "would you have done it the same way??"

    I have a character that can move around the screen, so I made him into a movie with all the animations necessary(moving feet, facing different directions). I placed him on the main stage along with some obstacles that he can't walk through.

    In order to make it easy to create new levels, I placed the collision detection on the obstacles in relation to the character. This way, I can just create new instances of the obstacle movie on the stage and it works instantly. If I had placed the collision detection code on the character, then I'd have to add a new line of code each time I added an obstacle in order to detect collision with that new instance of the obstacle. The obstacle movie loops between two frames, detecting collision between itself and the character on the first frame (so if I have 15 obstacles on the stage, 15 of these loops are running at once.)

    Once I have everything on the main stage, I perform the following operations:

    1. Countdown (it's a timed thing, so since my movie is 20 FPS, if 20 frames have passed, I reduce the clock by one second).

    2. I detect if an arrow key is being pressed and play the appropriate animation of the character and move him in the direction pressed.

    3. Check for game/level ending conditions.

    4. End game or loop back to start.


    This is my first flash game (I'm mainly an ASP/VB programmer), and this seemed like the most logical and flexible way of doing this, but I'm unhappy with the performance I'm getting. Any suggestions on streamlining this?


  2. #2
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Hey Jmarks2001, you may want to look in this tut..

    http://board.flashkit.com/board/show...hreadid=120084

    if you have any questions postem here.

    mad_sci

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