move_stop("blah,blah,blah", ¤t_sprite)
August 4th 2004, 07:20 AM

joe mcmartha


would someone please explain to me how the move stops work? all the numbers dont make any sense to me, if someone would explain it would be cool.
The 'dink c reference' v. 1.3 is the best source of all that info. But here is a start;
move_stop(Sprite#,Direction#,Stop at x or y, Hard0 ornot 1);
The sprite # can be a variable such as ¤t_sprite or the real # like 1 (Dink himself). The direction as per number pad, eg;9 is up and right.
Directions 8 and 2 will stop at the y axis. All other directions look for the X axis.
If the hard is set to 0 the sprite will stop when it bumps into any object with hardness. Be carfull, that can cause a lockup.
So,
freeze(¤t_sprite); // good to freeze him.
move_stop(¤t_sprite,6,300,1);
unfreeze(¤t_sprite);//remember to unfreeze him.
// now the sprite this script is attached to will freeze, walk to the right (even through objects) until he is halfway to the right, unfreeze, then the script will continue.('_stop' stops the script until the cordinate '300' is met) If the sprite is already on the right it won't seem to do anything.
move_stop(Sprite#,Direction#,Stop at x or y, Hard0 ornot 1);
The sprite # can be a variable such as ¤t_sprite or the real # like 1 (Dink himself). The direction as per number pad, eg;9 is up and right.
Directions 8 and 2 will stop at the y axis. All other directions look for the X axis.
If the hard is set to 0 the sprite will stop when it bumps into any object with hardness. Be carfull, that can cause a lockup.
So,
freeze(¤t_sprite); // good to freeze him.
move_stop(¤t_sprite,6,300,1);
unfreeze(¤t_sprite);//remember to unfreeze him.
// now the sprite this script is attached to will freeze, walk to the right (even through objects) until he is halfway to the right, unfreeze, then the script will continue.('_stop' stops the script until the cordinate '300' is met) If the sprite is already on the right it won't seem to do anything.
If the sprite is already on the right it won't seem to do anything.
Yeah, this makes it possible to do things like moving something to the center of the room without having to use if statements.
Compare, which one would you prefer? Both work the same:
Method 1.
int &dinkx = sp_x(1, -1);
if (&dinkx > 250 )
move_stop(1, 4, 250, 1);
else
move_stop(1, 6, 250, 1);
Method 2.
move_stop(1, 4, 250, 1);
move_stop(1, 6, 250, 1);
I always stick with the method 2. I think it's just nicer to do and saves some effort.
Yeah, this makes it possible to do things like moving something to the center of the room without having to use if statements.
Compare, which one would you prefer? Both work the same:
Method 1.
int &dinkx = sp_x(1, -1);
if (&dinkx > 250 )
move_stop(1, 4, 250, 1);
else
move_stop(1, 6, 250, 1);
Method 2.
move_stop(1, 4, 250, 1);
move_stop(1, 6, 250, 1);
I always stick with the method 2. I think it's just nicer to do and saves some effort.