i am making an fps and i have done collision, but as soon as i run the game the german does its dying animation, without me shooting it.
ty
hide mouse
make camera 1
load object "enfieldshoot.x",1
load object "enfieldreload.x",2
set object speed 2,1
set object light 1,2
append object "enfieldreload.x",1,21
delete object 2
load image "enfield.bmp",1
disable object zdepth 1
`remember - default scale is 100% - therefore 1000% is 10 times bigger
scale object 1,1000,1000,1000
texture object 1,1
load object "level1.x",3
position object 3,0,-200,0
set camera range 1,1,1000
set object speed 1,20
lock object on 1
position object 1,2.5,-1.5,4
`shooting
make object sphere 4,0.1
position object 4,0.3,-0.15,500
lock object on 4
make object sphere 5,0.1
position object 5,0.3,-0.15,1
hide object 5
point object 5,0.3,-0.15,500
`hud (healthbar)
load image "healthbarfull.bmp",2
load image "healthbar5%.bmp",3
load image "healthbar4%.bmp",4
load image "healthbar3%.bmp",5
load image "healthbar2%.bmp",6
load image "healthbar1%.bmp",7
load image "healthbardeath.bmp",8
sprite 1,500,400,2
scale sprite 1,50
`get german
load object "german\h-german-die.x",6
position object 6,0.3,-200,500
scale object 6,5000,5000,5000
set object speed 6,1
do
if mouseclick()=1 then play object 1,1,20;lock object off 5;move object 5,100;
if spacekey()=1 then play object 1,21,131
if upkey()=1 then move camera 1,1
if downkey()=1 then move camera 1,-1
if object collision(5,6)=then delete object 5;make object sphere 5,0.1;position object 5,0.3,-0.15,1;hide object 5;point object 5,0.3,-0.15,500;play object 6
if object collision(5,3)=then delete object 5;make object sphere 5,0.1;position object 5,0.3,-0.15,1;hide object 5;point object 5,0.3,-0.15,500;
`camera mouse
CAMY#=CAMY#+MOUSEMOVEX()*.1
CAMX#=CAMX#+MOUSEMOVEY()*.1
IF CAMX#>90 AND CAMX#<135 THEN CAMX#=90
IF CAMX#>270 AND CAMX#<225 THEN CAMX#=90
YROTATE CAMERA CAMY#
XROTATE CAMERA CAMX#
YROTATE camera 1,CAMY#
XROTATE camera 1,CAMX#
`health bar
if keystate(6)=1 then delete sprite 1;sprite 1,500,400,3;scale sprite 1,50
if keystate(5)=1 then delete sprite 1;sprite 1,500,400,4;scale sprite 1,50
if keystate(4)=1 then delete sprite 1;sprite 1,500,400,5;scale sprite 1,50
if keystate(3)=1 then delete sprite 1;sprite 1,500,400,6;scale sprite 1,50
if keystate(2)=1 then delete sprite 1;sprite 1,500,400,7;scale sprite 1,50
if returnkey()=1 then delete sprite 1;sprite 1,500,400,8;scale sprite 1,50
loop
"Thank you, come again!"