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.

3 Dimensional Chat / strafing >>> HOW ???

Author
Message
Cameldude
21
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 24th Jan 2003 21:12
How can i make an object move to the left or the right without rotating it ? Do I have to make complex commands for that ?
Soyuz
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 24th Jan 2003 21:25
How about the command "MOVE OBJECT LEFT"

hehe
Cameldude
21
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 24th Jan 2003 21:32
Maybe it's because I'm still using the demo, but I do not have that command, it does not work...
Better get that full version real fast

Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 24th Jan 2003 21:38
There is a better way, but it is slightly more complicated but if your going to make neat code then I reccomend using it...

x#=newxvalue(x#,wrapvalue(a#+90),strafespeed)
z#=newxvalue(x#,wrapvalue(a#+90),strafespeed)

newzvalue finds where you need to move in 3d space according to the angle that you are 'facing'. If your at 0 degrees then obviously your only going to travel along the z axis (imagine a graph with axis).



But if you are at an angle then you are going to travel along the x and z axis. You can work this out using sin and cos but these commands do it for you. the first number in the brackets is the position that you are moving from, the second is the angle that you are standing at and the third is the distance you want to move forward.

If you set the angle 90 degrees to one side then you can strafe from side to side.



Yum! Yum! Yum! Yum!
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 24th Jan 2003 21:40
Wrapvalue wraps the angle around incase it goes over 360 or under 0 as the calculations wouldnt work with angles out of that range

Yum! Yum! Yum! Yum!
Cameldude
21
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 24th Jan 2003 22:42
THX very much... No shooter without strafing

Fletch
21
Years of Service
User Offline
Joined: 5th Feb 2003
Location:
Posted: 5th Feb 2003 19:23
A really simple version would be to -

Turn object left 1,90
Move object 1,10
Turn object right 1,90

P4 2.55 Ghz 512MB Ram nVidia Geoforce 4

19" TFT disp.
Megaman X
21
Years of Service
User Offline
Joined: 21st Oct 2002
Location: Sweden
Posted: 6th Feb 2003 21:14
Take a look at the new tutorials in the tab "Create" from DB's main page (www.darkbasic.com). They teach how to make strafing, bullets and so on... great tuts btw

"A true warrior fights with skill, not anger..."

Gif edited by Kangaroo2

Login to post a reply

Server time is: 2024-04-18 04:52:54
Your offset time is: 2024-04-18 04:52:54