-
Mixed Tilebased & Artbased Engine
So, for fun, I were foolin around with a tilebased jump n' run engine of me, which i used for a crap game. In this engine, I attached multiple area-mc's into a stage-mc and then checked for collisions with that. It used to work nice, so I've used that idea another time. I've mixed the easy mapcreation of the tilebased engine with the easy collision detecting and the other good things of the artbased engine!
With a map array I create my tilebased map as usual, but before adding a tiles-movieclip to the tileholder, I check about the current tile ( in the array ) is zero. If it isn't, I attach the tile, if it is zero, I don't do anything. So in the tileholder-mc, there's just an empty space.
The good things about that are, that I can easily check for collisions with the ground with using just hitTest with the tileholder, no worry about the center of my player and so on, so I don't need to execute complex mathematical functions every frame -> better performence.
So, a tile can also not fill out the complete space and if your character doesn't hit the filled space, he falls down. So easy is it!
And if I want another object innit, that isn't tilebased, I just can add it without worrying about much coding.
For the background, I can use another array or just a picture.
Just wanted to share the idea, if you knew it already, then don't matter, but maybe add some ideas, please
If you didn't knew it, you maybe can learn something of it.
mfg Noob
Last edited by davenaegeli; 11-13-2005 at 07:16 PM.
-
i was using nearly the same technique as yours in my mario game.
but instead of hittesting the player with the tileHolder , i created an invisible hit map, because i wanted to make walkable and non-walkable tiles.
i thought this is a good way of doing a tile based game, unitl flash 8 came out with all the bitmapdata stuff. now i use the same technique , but with bitmaps.
i create a big ass bitmapdata and put all the tiles in it with copyPixels(). and the hitmap is just a bitmap as big as the main tilebitmap, but only black and white. the white tiles are walkable, and the black aren't. this is so goddamn fast, even with maps as big as 180x180.
the only bad thing is, that you can't make maps bigger than 2880x2880 pixels, because the bitmapdata's can't get any bigger. but it wouldn't be hard to split the map into parts.
i suggest you to go for this technique. its sooo cool
-
Since I haven't got flash 8, I can't use this...
And you generate the hitmap per a loop that checks all the tiles in the standart map, and depends of which tile it is, you add a black or a white tile to the hitmap? Nice idea, though...
mfg Dave
-
yeah... all i got is a tilebased map that's created with an artbased guy who literally hitTests bricks. makes it very very very very simple.
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
|