09-27-2004, 03:44 AM
09-27-2004, 03:49 AM
i have a task for any VB coder who wants to try their hand..
if you'll notice, when both player's laser's hit each other, they explode. that explosion was initially meant to kill anyone who touches it. can someone add that bit of code in? there already is a function in there where i tried to code it, but i suck with radius stuff. so can anyone try to add that function's code? and if you do, please dont changhe any other code...
if you'll notice, when both player's laser's hit each other, they explode. that explosion was initially meant to kill anyone who touches it. can someone add that bit of code in? there already is a function in there where i tried to code it, but i suck with radius stuff. so can anyone try to add that function's code? and if you do, please dont changhe any other code...
09-27-2004, 04:00 AM
Code:
Function ExploKilled(mPlayer As Integer) As Boolean
ExploKilled = False
px = player(mPlayer).mShape.Left
wdth = player(mPlayer).mShape.Width
py = player(mPlayer).mShape.Top
hgt = player(mPlayer).mShape.Height
If px + wdth > explosion.Left And px < explosion.Left + explosion.Width Then
If py + hgt > explosion.Top And px < explosion.Top + explosion.Height Then
ExploKilled = True
End If
End If
End Function
Square box mode, to make it circle, you would do something like:
distance = SQR((px-explox)^2 + (py-exploy)^2)
And then check:
If distance < explosion.widht (or height) Then killed
Roughly...
09-27-2004, 07:05 AM
http://quickhost.qbtk.com/download.php?id=239
Tab and Del are the new Mine buttons
im VERY proud of the gfx i did for those Mines
also, can someone actually write out the exact radius code i would need?
Tab and Del are the new Mine buttons
im VERY proud of the gfx i did for those Mines
also, can someone actually write out the exact radius code i would need?
09-27-2004, 12:33 PM
I don't know VB... Well, I know Baby VB(QB) and some math, but anyway...
Wouldn't you just use the distance formula for a radial exlosion?
[quote="A Z!re"]
distance = SQR((px-explox)^2 + (py-exploy)^2)
[quote]
I don't know if it matters in VB, but in QB it makes a hella difference in speed, if you do it with mul's only...
Rx=(px-explox)
Ry=(py-exploy)
Dist=Sqr(Rx*Rx+Ry*Ry)
If Dist<= BombRad then
BlowTheShitOutOfTheThing Thing%
End If
Maybe you already know this though... :lol:
I just couldn't think of a better way for it.
Wouldn't you just use the distance formula for a radial exlosion?
[quote="A Z!re"]
distance = SQR((px-explox)^2 + (py-exploy)^2)
[quote]
I don't know if it matters in VB, but in QB it makes a hella difference in speed, if you do it with mul's only...
Rx=(px-explox)
Ry=(py-exploy)
Dist=Sqr(Rx*Rx+Ry*Ry)
If Dist<= BombRad then
BlowTheShitOutOfTheThing Thing%
End If
Maybe you already know this though... :lol:
I just couldn't think of a better way for it.
09-27-2004, 06:24 PM
the main problem i have is that i made the explosion using
object.Left = object.Left - 1
object.Top = object.Top - 1
object.Width = object.Width + 2
object.Height = object.Height + 2
see? aint even usin any radius...
object.Left = object.Left - 1
object.Top = object.Top - 1
object.Width = object.Width + 2
object.Height = object.Height + 2
see? aint even usin any radius...
09-27-2004, 06:49 PM
thanks for both of your helps, it works now. but im waitin for me to impliment more features and pickups before i release another ver....
anyone EXCITED!?
anyone EXCITED!?
09-27-2004, 08:56 PM
added AI
watch for any bugs
notice the new powerup item
http://quickhost.qbtk.com/download.php?id=241
it seems there IS reward in organization... never would i have thought my code could get so large and so easily manipulated to add a third AI player...
watch for any bugs
notice the new powerup item
http://quickhost.qbtk.com/download.php?id=241
it seems there IS reward in organization... never would i have thought my code could get so large and so easily manipulated to add a third AI player...
09-28-2004, 08:29 PM
*bump* this is fun, trust me.
09-28-2004, 11:14 PM