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 / Moving a object around a Player

Author
Message
Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 23rd Aug 2013 21:15
Hi,

I know this is another problem with the last not being fully solved and a completely different subject but I needed to do something as I didn't have a clue how to fix the current (other one) issue I am having.

This issue is about AI and formations for a army. At the moment I am trying to do two different line formation one with one line and another with two or more lines.

I can line them up fine in a line of one and nearly perfectly in a line of two but this doesn't work the way I want it too as it only works on the x axis which means its useless effectively because I want it to turn and move around when the player does meaning it can be done at any angle and in any direction but I can't work out the code.


I don't know if I explained it well enough but if I haven't just say and I'll try and make it more clear.


Thanks yet again!
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Aug 2013 21:24
Hi,

Look into trigonometry to solve your problem. You can line them up and then rotate the entire line afterwards. Here's an example in 2D:



TheComet

Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 24th Aug 2013 15:23
Thank you very much!!! It work's perfectly! Now I can start doing the rest!

Thank you!

Login to post a reply

Server time is: 2026-07-07 00:10:01
Your offset time is: 2026-07-07 00:10:01