Page 1 of 1

Vector Add?

PostPosted: Sat Jul 09, 2011 2:35 am
by Toasterman
I'm back! With a question!
My computer crashed (losing all my GE stuff) and after a few months of depression I've picked up Game Editor again!

So to the point: how does vector add work? There is no data entry in the script reference and I found a whole lot of nothing via the search.
What is it? What is it useful for? Dissect the code itself (what's up with those one symbols -&- anyway?) Any information would be good.

What I'm wanting to do with it is make my own path system for enemies- specifying several coordinates and having an enemy follow the path nodes. I'd hoped that the vector add function might make the enemy's path "smooth out" and sorta round off the corners of the path, so it isnt so rigid.

Any help appreciated :D

Re: Vector Add?

PostPosted: Sat Jul 09, 2011 3:08 am
by jimmynewguy
Documentation:
vectoradd: Adds vector2 (angle2, magnitude2) to vector1 (angle1, magnitude1) and returns the result in vector1 (angles in degrees).

Example:
http://game-editor.com/examples/vectoradd.zip

Attempt to explain:
So basically you add vectors (aka angle and direction). Not sure how to explain the &, it's pretty much just how you state it with vector add.

Code: Select all
vectoradd(&angle1, &velocity1, angle2, velocity2);


Explanation on vectors maybe will help? http://www.physicsclassroom.com/class/vectors/u3l1b.cfm

Sorry I'm not very good at explaining things. If this doesn't help at all just let me know and I'll try to explain again. :lol: