A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 22

Thread: [F9] Addchild and scrolling engines

Hybrid View

  1. #1
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188

    [F9] Addchild and scrolling engines

    Hi,

    Sorry for all the Flash9 questions

    I'm working on a tile based scrolling engine in AS3. Is it safe to just create all the movieclips for all the tiles up front, and only add them to the correct layers with Addchild when visible? Or will they slow down my engine even when they are not added to the DisplayObjectContainer? I suppose they would take up some ram, but I'm not sure how much of a problem this would be.

    Any insight would be greatly appreciated.

  2. #2
    Heli Attack! iopred's Avatar
    Join Date
    Jun 2003
    Location
    Sydney, Australia
    Posts
    923
    That method is sure to work, but puts a lot of code execution up front when loading the map for the first time. And you also nailed the major drawback, ram usage is sure to skyrocket, especially if you use BitmapData.
    Christopher Rhodes
    squarecircleco.

  3. #3
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    thanks, so it's probably better to just store objects with the name of the movieclip/bitmapdata/whatever, and create them in runtime?

  4. #4
    Heli Attack! iopred's Avatar
    Join Date
    Jun 2003
    Location
    Sydney, Australia
    Posts
    923
    That's how I would do it, create the actual display object when needed.
    Christopher Rhodes
    squarecircleco.

  5. #5
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    Ok, so still the good old way
    Oh, wait, for sprites (not the new sprite class, but traditional sprites) I think this would actually be a good idea. For some games, you can't just delete the sprites when they go off screen, but having a lot of them on the stage would slow things down, so removing them from the displayobjectcontainer would probably be better.

  6. #6
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    Okay, my scrolling engine is nearly finished, just needs some more optimizations and some small changes.
    It's pretty cool, I support different types of layers (tiles only at the moment but easily extendable to add sprite layers, etc), parallax scrolling, multiple types of tiles (MovieClip, Sprite, BitmapData which can use one tilesheet and an index to add a certain tile, and the possibility to add new types, ie supertiles), which can be mixed on the same layer, and a setting per layer to indicate whether to use cacheAsBitmap or not. Oh yeah, and it can load tiles/tilesheets from an external movieclips's library if desired. It's pretty fast, too.

    I'm considering making this freely available in a few days, would there be any interest?

  7. #7
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    yes
    lather yourself up with soap - soap arcade

  8. #8

  9. #9
    Feeling adventurous? T1ger's Avatar
    Join Date
    Mar 2004
    Posts
    850
    yes
    I don't have a photograph, but you can have my footprints. They're upstairs in my socks.

  10. #10
    Senior Member
    Join Date
    Jun 2001
    Posts
    290
    yes

  11. #11
    Style Through Simplicity alillm's Avatar
    Join Date
    Mar 2004
    Location
    Wales
    Posts
    1,988
    yes
    (what was the question?)

  12. #12
    more now more
    Join Date
    Sep 2005
    Location
    Brighton, UK
    Posts
    80
    yes
    \\ \\\
    \\\\\\

    FuturLab | Blog

  13. #13
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    Huh. Don't expect too much
    I'll try to finish it up asap and I'll release the source.

  14. #14
    Patron Saint of Beatings WilloughbyJackson's Avatar
    Join Date
    Nov 2000
    Location
    Ro-cha-cha-cha, New York
    Posts
    1,988
    No.

    Okay...I'm just saying that to be different...

  15. #15
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    Sorry I'm a n00b when it comes to game scripting.
    Would I be able to use the scrolling engine for an overhead space shooter?

  16. #16
    Patron Saint of Beatings WilloughbyJackson's Avatar
    Join Date
    Nov 2000
    Location
    Ro-cha-cha-cha, New York
    Posts
    1,988
    Quote Originally Posted by jAQUAN
    Sorry I'm a n00b when it comes to game scripting.
    Would I be able to use the scrolling engine for an overhead space shooter?
    I'd recommend avoiding this engine if your a n00b since it will be in AS3.

  17. #17
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    Quote Originally Posted by WilloughbyJackson
    I'd recommend avoiding this engine if your a n00b since it will be in AS3.
    I can write AS2.0 pretty good so it wouldnt be that huge of a jump for me. But none the less I agree in that I don't wanna take on two learning tasks at the same time.

    Are the engines commonly used in overhead shooters considered "tile based".

  18. #18
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    Quote Originally Posted by jAQUAN
    I can write AS2.0 pretty good so it wouldnt be that huge of a jump for me.
    you speak gibberish... sleep my child, there is a long journey ahead of thee
    lather yourself up with soap - soap arcade

  19. #19
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    Quote Originally Posted by mr_malee
    you speak gibberish... sleep my child, there is a long journey ahead of thee
    Depends on how good his knowledge on object oriented programming is. If you know that, learning as3 isn't that difficult. Especially if you have some experience with c# or java.
    If you don't understand what a class or object is, or what inheritance is, then yeah, it'll take a while to get used to everything.

  20. #20
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    Plus I can't guarantee that it's any good, lol. But yeah, basically it could be used to make an overhead shooter.

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