06-06-2024, 12:37 AM
(06-05-2024, 05:40 PM)Marcus Wrote: Can't check the code right now. But if you are in the enemy bullet's Update function, just call "if .CollidesWith(vPlayer)", if your player is in a visible variable named vPlayer.
Thank you, now it's working !
.CollidesWith(vPlayer) is working perfectly
click each image to zoom-in
Code:
function CreateEnemyBullet(id, img, x, y, z, dx, dy, dz)
...
b.Update = function(dt)
...
if res.any
EA_RemoveObject(this)
else
'collision detection enemy's bullet and player
if .CollidesWith(vPlayer)
set color 255,0,0,200
draw rect 0,0,width(primary),height(primary),1
redraw
fwait 10
endif
endif
endfunc
return b
endfunc