Xtreme
03-21-2001, 11:31 AM
I am making a tile game like bomber man.
however i have run into a problem. When i place bombs on the screen i want them to have their own detonation counter that makes them explode when it = 100. therefore if i lay one bomb it will explode when its counter = 100 and when i place a second bomb its counter will be independant and start at 0 and count up to 100 and if i place a third it wil start at 0 and count up to 100.bomb1 will explode 1rst, bomb2 next, and bomb3 last.
This is the code i have:
counter = 0
For tiley = 0 To MaxTilesY
For tilex = 0 To MaxTilesX
Select Case Map(tiley, tilex)
Case Asc("3") '''a.k.a we are drawing the tiles on the screen and we have come
'''come across a laid bomb
counter = counter + 1
timer(counter) = timer(counter) + 1
if timer(counter) = 100 then
'''''i put code in here for the bomb to explode
timer(counter) = 0
end if
End Select
Next Tilex
Next Tiley
Can anyone see a problem with this code?
Thanks
however i have run into a problem. When i place bombs on the screen i want them to have their own detonation counter that makes them explode when it = 100. therefore if i lay one bomb it will explode when its counter = 100 and when i place a second bomb its counter will be independant and start at 0 and count up to 100 and if i place a third it wil start at 0 and count up to 100.bomb1 will explode 1rst, bomb2 next, and bomb3 last.
This is the code i have:
counter = 0
For tiley = 0 To MaxTilesY
For tilex = 0 To MaxTilesX
Select Case Map(tiley, tilex)
Case Asc("3") '''a.k.a we are drawing the tiles on the screen and we have come
'''come across a laid bomb
counter = counter + 1
timer(counter) = timer(counter) + 1
if timer(counter) = 100 then
'''''i put code in here for the bomb to explode
timer(counter) = 0
end if
End Select
Next Tilex
Next Tiley
Can anyone see a problem with this code?
Thanks