KKong

02-21-2002, 01:31 PM

Hi,

I've just started coding a tile based game.

and wonder if somebody could give me some advice on the code below.

I am currently creating a random world 40x40 with 32x32 squares. Currently there are only two different tiles.

This is no problem.

The problem I have is when displaying this.

For i = 1 To 40

For j = 1 To 40

If MapArea(i, j) = 0 Then

screen.PaintPicture tile1.Picture, (i) * 32, (j) * 32

End If

If MapArea(i, j) = 1 Then

screen.PaintPicture tile2.Picture, (i) * 32, (j) * 32

End If

Next j, i

The tiles display but the first row on both axis stays white.. I know why this is because of the (I) * 32 part..

I was just wondering what other ways can this be tackled with.

Also eventually as the tile set grows bigger what would be the better way to continue.

thanks.

Scot.

I've just started coding a tile based game.

and wonder if somebody could give me some advice on the code below.

I am currently creating a random world 40x40 with 32x32 squares. Currently there are only two different tiles.

This is no problem.

The problem I have is when displaying this.

For i = 1 To 40

For j = 1 To 40

If MapArea(i, j) = 0 Then

screen.PaintPicture tile1.Picture, (i) * 32, (j) * 32

End If

If MapArea(i, j) = 1 Then

screen.PaintPicture tile2.Picture, (i) * 32, (j) * 32

End If

Next j, i

The tiles display but the first row on both axis stays white.. I know why this is because of the (I) * 32 part..

I was just wondering what other ways can this be tackled with.

Also eventually as the tile set grows bigger what would be the better way to continue.

thanks.

Scot.