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.

DarkBASIC Discussion / Firing Arrows

Author
Message
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 23rd Feb 2004 15:31
I am making a game and I want to be able to fire arrows. This works fine apart from the fact that the camera is controlled by the mouse so the arrow isn't always rotated the right way. How can I change it so that the arrow always points the right way?

Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 23rd Feb 2004 20:02
should be easy

position object arrow, camera position x()+sin(camera angle y())*5,camera position y()+sin(camera angle x()-180)*5,camera position z()+cos(camera angle y())*5

point object arrow, camera position x()+sin(camera angle y())*8,camera position y()+sin(camera angle x()-180)*8,camera position z()+cos(camera angle y())*8


Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 24th Feb 2004 14:51
Thanks I'll try that!

Login to post a reply

Server time is: 2025-05-22 17:34:53
Your offset time is: 2025-05-22 17:34:53