Announcement

User registrations are currently disabled due to high spam traffic.

#1 11/05/08 1:21pm

Dezerith
Moderator of Doom.
Registered: 27/07/07
Posts: 196
Website

Tile-based Flash Game

I'm making a tile-based flash game and I need help.

OK I worked out how to make a movie clip move in pixel measured increments, but the system I used for the tiles makes the tiles look all choppy when I export them to .swf. So i was wondering if there was a way I could load each tile externally into the flash document using a txt file or something? Kinda like what Jake is doing with Teleport...

Any ideas?

Jake -- I need you! big_smile

Last edited by Dezerith (11/05/08 7:52pm)


[img]http://i26.tinypic.com/28iys08.jpg[/img]
[img]http://www.resiststorage.org/images/blazebytedev53.png[/img]
[img]http://www.resiststorage.org/images/PSPflashForDezBzeByteDev4.png[/img]

Offline

 

#2 11/05/08 9:05pm

Jake
Administrator
Registered: 29/04/06
Posts: 307

Re: Tile-based Flash Game

I will see if I can come up with something (it is to late for me at the moment) If I forget just post some more stuff in this topic and I will be reminded.


moose

Offline

 

#3 14/05/08 5:55pm

Dezerith
Moderator of Doom.
Registered: 27/07/07
Posts: 196
Website

Re: Tile-based Flash Game

OK cool, I may as well tell you exactly what I'm looking for.

So basically I'm going to have a text file. In the text file (this is just an example) there would be some kind of code that represents a tile. For example, if the code for an area in the game would be:

[1][1][1][1][1][1][1][1][1][1][1][1]
[2][2][2][2][2][2][2][2][2][2][2][2]
[2][2][2][2][2][2][2][2][2][2][2][2]
[2][2][2][2][2][2][2][2][2][2][2][2]
[1][1][1][1][1][1][1][1][1][1][1][1]

Each [#] represents a tile. The number links to the filename of the tile, so if [1] was a wall tile and [2] was a floor tile, I'd have a map like the above imported into my flash document. Catch my drift?


[img]http://i26.tinypic.com/28iys08.jpg[/img]
[img]http://www.resiststorage.org/images/blazebytedev53.png[/img]
[img]http://www.resiststorage.org/images/PSPflashForDezBzeByteDev4.png[/img]

Offline

 

#4 15/05/08 1:10pm

Zuriki
Flash Dev (The Lazy One)
From: Manchester
Registered: 18/01/08
Posts: 755
Website

Re: Tile-based Flash Game

No if you were using standard Array();

then it would be floor1=[[1,2,1,2,2,3,1,2,3,2,4,1,4,1]]

if you were using variables on the other hand you can throw out the [[]]s and just have

floor1=1,2,1,2,2,3,1,2,3,2,4,1,4,1

I'm not going to go into parsing them and making each movieclip read them.

Jake can do that, he probably can do it more efficiently than me anyway.


[img]http://img134.imageshack.us/img134/9129/headerxt2.png[/img]
[url=http://zuriki.co.nr/project/traveller/][img]http://i28.tinypic.com/2vspafo.png[/img][/url]
[url=http://zuriki.co.nr]Zuriki - PSP Flash Games[/url]

Offline

 

#5 15/05/08 1:28pm

69corvette
That one guy.
From: Not Palmdale, CA
Registered: 01/02/08
Posts: 281

Re: Tile-based Flash Game

If hes using a two dimensional array
   array = [ [1,2,3,4,1,2,1] ,
                 [1,1,1,1,1,1,1] ,
                 [2,1,3,1,4,1,2] ];
or something like that...
and use two for loops to go through it...

for(i=0;i<array.length;i++){
    for(j=0;j<array[i].length;j++){
        //do something with this tile array[i][j];
        //you could load the value at that point
    }
}


[img]http://img221.imageshack.us/img221/8990/smallersigcopylb1.jpg[/img]

Offline

 

#6 16/05/08 5:42pm

Dezerith
Moderator of Doom.
Registered: 27/07/07
Posts: 196
Website

Re: Tile-based Flash Game

OK I know nothing about arrays and what have you, I was just using that code as an example I made up. If using arrays is efficient, can someone briefly run through how I could do it?


[img]http://i26.tinypic.com/28iys08.jpg[/img]
[img]http://www.resiststorage.org/images/blazebytedev53.png[/img]
[img]http://www.resiststorage.org/images/PSPflashForDezBzeByteDev4.png[/img]

Offline

 

#7 17/05/08 12:14am

69corvette
That one guy.
From: Not Palmdale, CA
Registered: 01/02/08
Posts: 281

Re: Tile-based Flash Game

I just did...


[img]http://img221.imageshack.us/img221/8990/smallersigcopylb1.jpg[/img]

Offline

 

#8 17/05/08 8:20am

Dezerith
Moderator of Doom.
Registered: 27/07/07
Posts: 196
Website

Re: Tile-based Flash Game

69corvette wrote:

I just did...

Yeah but it makes no sense whatsoever to me...


[img]http://i26.tinypic.com/28iys08.jpg[/img]
[img]http://www.resiststorage.org/images/blazebytedev53.png[/img]
[img]http://www.resiststorage.org/images/PSPflashForDezBzeByteDev4.png[/img]

Offline

 

#9 23/06/08 5:49am

nothing
Moderator
Registered: 21/03/08
Posts: 389

Re: Tile-based Flash Game

Search up Tonypa. I'm reading that.

A little late, but hey...who cares?


[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]

I'm starting p22 again.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson