PDA

View Full Version : XML/Tile Based Game - Still used in CS3?



thejoeknows.com
March 14th, 2008, 07:17 PM
is using a tile based game still the best way to make a side scrolling game in flash?
with using an xml tile based map?

im learning using tile based but am afraid thats not still what is most useful

-thank you

TCAtect
March 14th, 2008, 10:23 PM
Believe it or not, the tile-based method is still being employed everywhere, for its simplicity and efficiency. The simplicity of building various maps with a few tiles, and the efficiency/ease of modifying a huge map by modifying a few values makes tile-based systems suitable for many game genres. I could go on to talk about scalability (huge art-based maps lag a lot in Flash), variations (isometric tiles) but you probably won't want to hear any of that :P. So, to answer your question, yes, tile-based system is still "usable", and still one of the best ways to make side-scrollers in Flash. I would even go as far as saying it is the best system. But then again, I'm a tile-lover.

One of the best resources on tile-based game systems in Flash is Tonypa's site:
http://www.tonypa.pri.ee/tbw/index.html

and OutSideOfSociety's site
http://oos.moxiecode.com/

Though most of the tile-based tutorials they have are AS 2.0, which is certainly not a bad language, though if you want to "keep up", you might want to learn and use AS 3.0.

Good luck,
TCAtect

thejoeknows.com
March 15th, 2008, 01:22 PM
i have been using tony pa's tutorials for quite some time now and love them

where could i find some that work with AS3?

TCAtect
March 15th, 2008, 01:44 PM
Must be your lucky day. A search for "Actionscript 3 tile-based" yielded the following:

http://www.tonypa.pri.ee/tbw/as3/start.html

Even I didn't know about it! :D

thejoeknows.com
March 15th, 2008, 01:57 PM
wow i LOVE you
i have been using his old tutorials forever
heres a link to the game im working on now
Escape - My Tile Based Game (http://thejoeknows.com/gam3s/escape.html)
it has to be in flash 5 though...

my next game is going to be side scrolling with a physics engine
it is going to be called Ball Land: Space Adventure
on each planet there are different, realistic physics (height of jump, speed)
im so excited to be able to make in AS3

thejoeknows.com
March 15th, 2008, 02:36 PM
also, TCAtect (or anyone else)
i tried using one of the new tutorials
it gives you a .fla file and a .as file
can you tell me how to upload the .as file into the .fla
(it says that you have to)
thank you

motionsmith
March 15th, 2008, 02:48 PM
I've been working on a Platformer engine that doesn't implement tiles. It's all run using physics, and keeps a pretty good speed (usually more than 30 fps), even though it isn't optimized yet. You can read updates and info about it here:

http://blueflamedev.com/blog

Tiles are very efficient and quick, but it's also fairly limiting. I believe physics-based platformers will be the future of Flash platformers as the usability becomes easier to implement and as the Flash player becomes more efficient.

TCAtect
March 15th, 2008, 02:58 PM
also, TCAtect (or anyone else)
i tried using one of the new tutorials
it gives you a .fla file and a .as file
can you tell me how to upload the .as file into the .fla
(it says that you have to)
thank you

In AS 3, almost everything is based on classes. That said, you will have a whole bunch of .as files lying around. Don't worry though, it will actually make your life easier :D. The AS files do not have to be explicitly "imported" into the fla. Just keep the AS file in the same folder as the FLA file, so when Flash compiles the SWF, it can see the AS file, and if needed, will add the code automatically as it compiles. You really don't need to do anything other than making sure of the fact that the .as file has the same name as the class.

For example, if you have a class called character (public class character{}), the file should be called "character.as"

And that's it!

thejoeknows.com
March 15th, 2008, 04:08 PM
motionsmith: thanks for the link to the site the games are very impressive
but is it possible to make scrolling?

TCAtect: Tony Pas tutorials show how to make a gun shooting a character, but what about jumping on character to kill them (like in mario) is that possible in Tile Based?

TCAtect
March 15th, 2008, 04:14 PM
Yes, it is possible. Though I've personally never got into it, I don't think it would be too troublesome in a tile based engine. I believe a hitTest argument and a checking of the y positions of the character and the enemy will do (if yPlayer - yEnemy < 0, etc). Though there probably are much more efficient ways of doing it.

thejoeknows.com
March 15th, 2008, 04:20 PM
do you make any games? is ther any i can play/see?

motionsmith
March 15th, 2008, 04:25 PM
Scrolling is definitely possible in the Citrus Engine. It will be shown in my next demo next week. All I will be doing is inverting the hero's x velocity and setting that value to the level's container.

thejoeknows.com
March 15th, 2008, 04:27 PM
in the as3 tutorials by tony pa the animation for the walking is on a bitmap picture, and then a pattern makes the animation appear, can u explain this to me?

edit: what should i edit these bitmap sheets with? how does it know which part of the sheet to call upon?
it says edit with iexplore... whats iexplore? should i use that or something else? photoshop probably?

thejoeknows.com
March 15th, 2008, 04:42 PM
the citrus engine sounds very usable
once the scrolling demo comes out i will definately try it out

TCAtect
March 15th, 2008, 07:35 PM
in the as3 tutorials by tony pa the animation for the walking is on a bitmap picture, and then a pattern makes the animation appear, can u explain this to me?

I'm not quite sure, as I haven't taken a full look at this. But I believe that the bitmap is in a movieclip, with a mask the same size as each tile on top (maybe this could be achieved easily with a simple AS function), meaning that during runtime, you would only see one tile, not the whole tileset. More on masks here. (http://www.adobe.com/support/flash/drawing/creating_masks/)

Then, when an animation function is called, the bitamp below to mask moves accordingly (achieved by simple arithmetic, e.g. to show tile on row 1, column 2, it'd be movieClip.bitmapName.x = -(2*tileWidth); movieClip.bitmapName.y = -(1*tileHeight) to show the desired tile. Thus creating the illusion of "animation". The general formula would probably be something along the lines of:


movieClip.bitmapName.x = -(currentTileColumnNum*tileWidth);
movieClip.bitmapName.y = -(currentTileRowNum*tileHeight);Tonypa's tutorials probably has a more efficient function regarding this, though this is how I would logically approach it.



edit: what should i edit these bitmap sheets with? how does it know which part of the sheet to call upon?
it says edit with iexplore... whats iexplore? should i use that or something else? photoshop probably?


I believe you should edit the sheets with Adobe Photoshop (probably the best bitmap-based software out there with tons of tutorials), but if you don't have it, use Microsoft Paint. "iexplore" = Internet Explorer. You probably can't edit with that, it's just used to view the image. ;)

Good luck, happy scripting,
TCAtect.

motionsmith
March 15th, 2008, 10:57 PM
Regarding using bitmaps to create levels, it can be done pretty nicely, although there may be some performance hits when there becomes a lot of sprites on stage. Grant Skinner has a nice example in use here:

http://www.gskinner.com/blog/archives/2005/10/source_code_sha.html

His class is in AS2 (and it's very usable), but I've ported it to AS3 with no trouble. There are only a few lines of code that error out when compiling in AS3. Once those are fixed, you can get the performance boost that AS3 offers.

thejoeknows.com
March 16th, 2008, 01:36 AM
it wont let me export the sheets!
how do i create my own?
what size do i make them? i cant find it in the code

idjit
May 26th, 2008, 06:44 PM
=( tonypa disappeared =0 and so did his tutorials! where????