Page 1 of 1

what does this code mean?

PostPosted: Wed Feb 20, 2008 6:31 am
by kingqui
can some 1 tell me what this code interprets or says, because im not sure what it means,

int weight = 10;

x = ((weight - 1)*x + player.x)/weight;

I found this in the tutorial of making the view follow the actor 2, it shows you the scripting but it doesnt explain it????

Re: what does this code mean?

PostPosted: Wed Feb 20, 2008 11:01 am
by Thanx
Code: Select all
int weight


You create a variable called wieght.
Code: Select all
x = ((weight - 1)*x + player.x)/weight;


This gives the x of the actor a new value, calculated using the weight you give (it goes so much lower, it's so heavy) and the player actor's x that you're following.
:wink: