0 Replies - 448 Views - Last Post: 05 October 2012 - 12:29 AM Rate Topic: -----

#1 DimitriV  Icon User is offline

  • vexing conundrum
  • member icon

Reputation: 587
  • View blog
  • Posts: 2,746
  • Joined: 24-July 11

Better Blast Algorithm?

Posted 05 October 2012 - 12:29 AM

Hey guys, back again!
As some of you may know, I am coding a mine craft clone for my friends/brother/his fanatic friends. I recently read up about TNT on the Minecraft forum and how it blasts:


The TNT blast will propagate according to this formula f=e-r, where f is the force of the TNT blast after propagating through the block, e is the energy of the blast before propagating through the block, and r is the blast resistance of the block. Thus, the explosion propagates farthest (7 blocks) through air, which has a blast resistance of zero. However, TNT immediately enclosed in stone will destroy an exact 3x3x3 cube originating from the center of the blast. The damage is lethal at close range.

So, how would I do this? I have a TNT blast thing but it is much simpler:
Sub chkTNT(ByVal tntb As _2Blk)
Dim radius As New Rectangle (tntb.DrawLocation.X - 64, tntb.DrawLocation.Y - 64, 32 *5, 32 * 5) 
For i As Integer = 0 To objects.Count - 1
If New Rectangle(objects(i).DrawLocation.X, objects(i).DrawLocation.Y, 32, 32).IntersectsWith(radius) Then
objects(i).Btype = "blast1" 'just for animation purposes
End If
End Sub
'From memory I think this is it...

I am totally and utterly confused as to how to do this like in the quote above. Any suggestions are appreciated.
My above code sample isn't probably the best way to do this anyway.

This post has been edited by DimitriV: 05 October 2012 - 12:30 AM

Is This A Good Question/Topic? 0
  • +

Page 1 of 1