Hey everyone!
I'm having a small problem making a fps in DBC. When I press space, it makes the bullet fine, but it moves the camera and makes the bullet at the start position. How would I make it so it creates the bullet at the camera's current positiion.
This is my code that is not working.
set display mode 800,600,16
sync on: cls 0
make object sphere 1,12
make object cube 2,12
position object 2,rnd(200),0,rnd(200)
movebullet# = 0
camx# = camera position x()
camz# = camera position z()
do
if object exist(1)=1
text 100,100,"Hey Billy"
endif
if spacekey()=1
if object exist(1)=1
delete object 1
endif
endif
if returnkey()=1
if object exist(1)=0
make object sphere 1,12
position object 1,camx#,0,camz#
endif
endif
if object exist(1)=1
move object 1,1
endif
if upkey()=1 then move camera 1
if leftkey()=1 then turn camera left 1
if rightkey()=1 then turn camera right 1
sync
loop
Another thing is, can someone give me a code snippet for a first person shooter shooting system, so that it doesn't actually create bullets, but it finds if there is an object in the way of the bullet path. Thanks