A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Help with car Racer game

  1. #1
    Junior Member
    Join Date
    May 2001


    I am beginning work on a Flash top-view scrolling racing game (remember Micro Machines?)and I am wondering if I can achieve smoother scrolling by setting up the track pieces and scenery(trees,buildings,etc) "on-the-fly" i.e by loading the symbols as required rather than making the whole circut one big symbol and loading it in at the start of each course. Obviously there is some overhead from checking the cars position then finding and loading the appropriate symbols but would this outweigh the overhead of having to move around a massive graphic,only part of which can be seen on the screen at any given time?
    I realize that I could code an on-the-fly version and compare the two movies but this will take a considerable amount of development time that could be spent designing better graphics.
    If anyone has had any experience with these methods and could offer some advice it would be greatly appreciated.
    test run:


  2. #2
    Join Date
    May 2001
    I've used a similar technique in an RPG I'm developing (just like everyone else around here, heh) and I can tell you what I've observed.

    First off, there doesn't seem to be a huge amount of speed difference between the two of them. Flash is aparently fairly good at not wasting time worrying about things that are off screen.

    There are some advantages to doing it "on the fly", however. First off, there is the simple fact that if your track is very large, you will end up editing a HUGE object, which can be awkward.

    Also, if you are counting on using hitTest for hit detection, be aware that it can have some odd bugs when used on large objects. And of course, if you want to have scenery that you can drive over, (such as crosswalks, manholes, whatever) you'd have to figure out some way of keeping track what can and can't be driven over. (this is MUCH easier to do if you do it "on the fly" so that you can give each object a "solid" flag or something.)

    In general, I'd reccomend doing it "on the fly", with duplicateMovie or attachMovie to spawn scenery when you need it, and then move it around by hand. (I prefer attachMovie myself.) It will take a bit more work, but you'll end up with something that is a lot more versitile and easy to modify later.

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