
09-02-2007, 04:02 AM
|
Will work for food. Maybe
|
 |
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
|
|
vecx/y and sin cos are simple to learn with Graal. I learned that stuff way back in 7th grade on my own(I honestly don't know the true mathmatics behind it... though we did start getting into sine/cosine in Geometry).
vec stands for vector, in which you're getting the vectorx/y of a direction.
Basically, vecx and vecy are like the following arrays:
vecx={0,-1,0,1};
vecy={-1,0,1,0};
It's generally used to get the movement of a direction.
x=vecx(player.dir)
y=vecy(player.dir)
if your direction was 3, would return (1,0).
You can also multiply it like so:
player.x+=vecx(player.dir)*.5
player.y+=vecy(player.dir)*.5
Which would move the player .5 tiles in their direction. Sin/cos are kind of the same(in principle in Graal, I'm sure I will have the math guru's all over me for this post), in which it gets the 'movement' of an angle. |
|
|