hi guys
can anyone help me to convert this code from dbpro to darkgdk ?
`creat bullet for player (dummy version)
Make Object Sphere 212,5
Hide Object 212
`creat bullet for enemy (dummy version)
Make Object Sphere 213,10
Hide Object 213
player=215
Make Object Sphere player,10
Hide Object player
Sync On : Sync Rate 0
Do
posx#=object position x(player)
posy#=object position y(player)
posz#=object position z(player)
bX#=Object position X(212)
bY#=Object position Y(212)
bZ#=Object position Z(212)
MbX#=Object position X(213)
MbY#=Object position Y(213)
MbZ#=Object position Z(213)
`rem this is a bullet trigged when the left mouse button is pressed
if Mouseclick()=1 and BulletLife=0
position object 212,posx#,posy#+36,posz#
Set object to camera orientation 212
BulletLife =30
Show object 212
Endif
if BulletLife > 0 then gosub Shootbullet
If EnemyBulletLife > 0 then Gosub EnemyShootBullet
`when opening room door the enemy point at me with a gun
if door7=1
show object 1511
loop object 1511,10,10
set object speed 701,25
hide object 1501
stop object 1501
point object 1511,posx#,32,posz#
If EnemyBulletLife < 10
Position object 213,-1079,32,-447
Set object to object orientation 213,1511
`goto enemyshootbullet subroutine
EnemyBulletLife =500
show object 213
Endif
endif
Sync
Loop
Shootbullet:
`if the bullet is alive then move it
Dec BulletLife
Move object 212,90
if sqrt((wx# - bX#)^2 + (wy# - bY#)^2 + (wz# - bZ#)^2) < 20
print "THE ENEMY IS HIT"
hit=1
BulletLife = 0
Endif
`if the bullet is not alive then hide it
If BulletLife = 0 then Hide object 212
return
Rem Shoot Monster bullet
EnemyShootBullet:
Dec EnemyBulletLife
Move object 213,12
if Sqrt((posx# - MbX#)^2 + (posy#+25 - MbY#)^2 + (posz# - MbZ#)^2)<20
enemyBulletLife = 0
endif
Return
not all code but i cant understanding this line
if sqrt((wx# - bX#)^2 + (wy# - bY#)^2 + (wz# - bZ#)^2) < 20
wx#???
im not good in dbpro