|
-
[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.
-
Heli Attack!
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.
-
thanks, so it's probably better to just store objects with the name of the movieclip/bitmapdata/whatever, and create them in runtime?
-
Heli Attack!
That's how I would do it, create the actual display object when needed.
-
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.
-
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?
-
M.D.
-
hmm
-
Feeling adventurous?
I don't have a photograph, but you can have my footprints. They're upstairs in my socks.
-
-
Style Through Simplicity
yes
(what was the question?)
-
-
Huh. Don't expect too much 
I'll try to finish it up asap and I'll release the source.
-
Patron Saint of Beatings
No.
Okay...I'm just saying that to be different...
-
Total Universe Mod
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?
-
Patron Saint of Beatings
 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.
-
Total Universe Mod
 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".
-
M.D.
 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
-
 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.
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|