Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / shooting bullet

Author
Message
Zokomoko
22
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 1st Jan 2004 19:10 Edited at: 1st Jan 2004 19:20
hello

i have a combat flight simulator i make, the camera is the aircraft(first person view cockpit).
when i want to shoot a bullet, i first make the bullet and make it to point in the same direction as the camera.
then the bullet moves forward.
this is the code.
why the bullet does not shoot in the same direction as the camera?



if shiftkey()=1 and c#>d#+200

`----------------------------make bullet----------------
make object sphere s,6
position object s,camera POSITION X(),camera POSITION y(), camera POSITION z()
SET OBJECT TO camera ORIENTATION s
move object s,10
`----------------------------move bullet-------------------------------
move object i,96 (different part of the code, making the bullet to move each loop)
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 2nd Jan 2004 06:48
hmmmm... instead of "set object to camera orientation", try...

rotate object s,camera angle x(),camera angle y(),camera angle z()

your code should work... hmmmm... if the rotate object also doesn't work, try this...

move camera 1
point object s,camera position x(),camera position y(),camera position z()
move camera -1

well... I hope that helps, and good luck with your game...

Do not thwart the way of the dragon. For thou tasteth like chicken.
FROGGIE!
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: in front of my computer
Posted: 2nd Jan 2004 15:37
If your main loop is the same sort of structure as this:

DO
movement,ai etc...
BULLET
CAMERA MOVE/ROTATE

sync

then change the camera and the bullet parts around

():x:x::::::::::::

Login to post a reply

Server time is: 2024-11-25 23:46:11
Your offset time is: 2024-11-25 23:46:11