what does this code mean?

Game Editor comments and discussion.

what does this code mean?

Postby kingqui » Wed Feb 20, 2008 6:31 am

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????
kingqui
 
Posts: 12
Joined: Tue Feb 19, 2008 5:14 pm
Score: 0 Give a positive score

Re: what does this code mean?

Postby Thanx » Wed Feb 20, 2008 11:01 am

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:
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron