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 Professional Discussion / a few little questions

Author
Message
ssj3_shadow
23
Years of Service
User Offline
Joined: 12th Jan 2003
Location:
Posted: 3rd Jun 2003 06:04
i am after some code for controllinf a player character with a mouse click what needs to happen is when the user clicks on the screen i need the character to rotate so that it is facing in that direction and to move to the position.

also has any one played NWNbecause i need to make a camera controll much like this , rotate camera arround the character using the left and righr arrow keys and zoom in and out usinf the up and down arrow keys.

if any one could help you would be helping my situation out emmensly
thanks.
flibX0r
23
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 3rd Jun 2003 14:54 Edited at: 3rd Jun 2003 14:55
i smell a NOOB! sorry, i couldn't resist

Do you mean pathfinding, as in the player must walk around obsticles to get to where you want them? or do you just want it to turn towards the position you clicked and then move towards it?

As for the camera control, it is just a case of knowing some simple trigenometry. This code should work:



this assumes you will move in the xz plain and rotate on the y-axis. you can change this if nessesary. You will have to do the input stuff to change the variables "zoom_amount" and "angle#"

"But we couldn't do that Mr Flibble," questioned Rimmer. "Who'd clean up the mess?"
Twin P4 Xeon 2.0 Ghz, GeForce Quadro4 XGL 128MB, 1Gb DDR RAM, Twin 19" Flat Screens
ssj3_shadow
23
Years of Service
User Offline
Joined: 12th Jan 2003
Location:
Posted: 4th Jun 2003 05:41
n00b i think not.

just way to pre occupied with TAFE and UNI to have the time to sid down and create a function to move a camera. so n00b no.
but i do really appreciate your help.
eaven if im just a n00b

Login to post a reply

Server time is: 2026-07-11 14:55:42
Your offset time is: 2026-07-11 14:55:42