: Thursday, April 17, 2008 4:41 AM
To: Flash Coders List
Subject: Re: [Flashcoders] byteArray x/y
Terry,
// in randomize( ) in TileMap.as we have
// a value sometimes more than 12...
setTile(j, i, (i * numCols) + j);
// here ^
// But the original has a value never more than 12
Terry,
I had spacetiles.gif in line 26 of SpaceMap.as but have now changed it to
tiles.gif
// change spacetiles.gif to tiles.gif.
This code gives each row with the same tile numbers, like this
0123456700
0123456700
public function randomize (numTiles:int):void {
var numRows:int
Terry,
I think I know what might be going wrong for you.
You might be expecting something different.
Try this...
Instead of setTile(j, i, (i * numCols) + j);
Let's use tile 1 or tile 9...
Change that line to setTile(j, i, 1) or setTile(j, i, 9)
You see a 16x16 pattern repeated.
The 12 tiles
] Behalf Of John
McCormack
Sent: Friday, April 18, 2008 10:17 AM
To: Flash Coders List
Subject: Re: [Flashcoders] byteArray x/y
Terry,
I think I know what might be going wrong for you.
You might be expecting something different.
Try this...
Instead of setTile(j, i, (i * numCols) + j);
Let's use tile
Terry,
// in randomize( ) in TileMap.as we have
// a value sometimes more than 12...
setTile(j, i, (i * numCols) + j);
// here ^
// But the original has a value never more than 12
setTile(j, i, Math.floor(Math.random()*numTiles));
// here ^^^
//
should read //Line 28 in TileSet.as?
Thanks,
Terry
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of John
McCormack
Sent: Thursday, April 17, 2008 4:41 AM
To: Flash Coders List
Subject: Re: [Flashcoders] byteArray x/y
Terry,
// in randomize( ) in TileMap.as
Hi,
The TileSet class will split up a bitmap into square tiles for you -
look at the convertBitmapTiles function.
It also has a loadTiles function which does all this for you.
Have a look at the SpaceMap demo - which uses the TileMap, TileSet
the dragging stuff.
TileMap
7 matches
Mail list logo