I want to know: if I constrain two real attributes to the player's X and Y coordinates, and change the real attributes themselves, would the player's X and Y coordinates change as well?
Comments
gyroscopeI am here.Member, Sous Chef, PROPosts: 6,598
Basically a variable is something that can change. By inserting an extra element to the constraint expression you can have it reference not only the x or y pos but something else you want to add/subtract or otherwise vary the position number with. Perhaps you can imagine the case of a fly that you want to chase the finger of your player. It would be dull to have it just locked to the finger, but vastly more amusing to have meander/buzz about in the general area of the finger. You could do this by putting an additional rising and falling number on top of the finger coordinates. By generating some rising and falling numbers over time possible (in a number of ways), an actor integer or real number attribute could be constrained to them, and then your actor's main constraint to the finger coordinates would be modified to something like-
constrain self x to touch one x plus self fly value x
and the same with the y
constrain self y to touch one y plus self fly value y
and hopefully joyous things start to happen with the fly buzzing about the finger tip and not just fixed to it. Once you grasp the variables thing (it took a while for me to really start to design with them in mind), it will open up a whole new level of thinking and what you can achieve.
Comments
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
@gyroscope: Would it work if I constrained the X and Y coordinates to the (unnamed) real attributes?
@old_kipper: What does adding variables mean and how could I add them?
constrain self x to touch one x plus self fly value x
and the same with the y
constrain self y to touch one y plus self fly value y
and hopefully joyous things start to happen with the fly buzzing about the finger tip and not just fixed to it. Once you grasp the variables thing (it took a while for me to really start to design with them in mind), it will open up a whole new level of thinking and what you can achieve.
kipper