Game Development Reference
In-Depth Information
ahoa
w
@nklpda]llha***
y
Keep that in mind because this is what the actual code looks like:
eb$lh]uanD]o=llha%
w
lh]uan*]``?deh`$]llha%7
]llha*t9,7
]llha*u9,7
lh]uanD]o=llha9pnqa7
y
ahoa
w
op]ca*]``?deh`$]llha%7
]llha*t9lh]uan*t7
]llha*u9lh]uan*u7
lh]uanD]o=llha9b]hoa7
eb$ajaiu*depPaopK^fa_p$]llha%%
w
iaoo]ca@eolh]u*patp9Pd]jgo7
y
y
Is that making a little more sense now?
But how is the code actually picking up and dropping the object? First, let's look at the directives that
pick up the apple:
lh]uan*]``?deh`$]llha%7
]llha*t9,7
]llha*u9,7
lh]uanD]o=llha9pnqa7
You used the ]``?deh` method to make the ]llha a child object of the lh]uan object. So like a baby
duckling, wherever the lh]uan goes, the ]llha is sure to follow.
You then set the t and u position of the apple to ,. Because the ]llha is now a child of the lh]uan
object, it uses the lh]uan object's coordinate system. An t and u position of , positions it in the very
center of the lh]uan object. For your purposes, this happens to be very conveniently on the tip of the
pig's nose.
 
Search Nedrilad ::




Custom Search