The Dink Network

Reply to Re: X y movement commands

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
May 31st 2012, 02:26 PM
pillbug.gif
pillbug
Peasant He/Him United States
Love! True love! 
I'm assuming the difficulty is coming from having the boss go to those coordinates from any point on the screen?
I would suggest creating a sprite at those coordinates and using sp_follow(&boss, &sprite); Something like this:

//Wherever you have the previous move() commands at
int &sprite = create_sprite(315, 100, 0, 80, 24);
//Above sprite is the stone statue head thingy
set_smooth_follow(1);
sp_follow(¤t_sprite, &sprite);


The boss won't go to those exact coordinates, it will go a bit off of the statue, so experiment with the statue's coordinates to get the boss right where you want him.

EDIT:
If I'm way off here and you're just trying to get him move, use:
freeze(&current_sprite);
move_stop(&current_sprite, <dir>, <coordinate>, 1);


<dir> is a number from 1-9, and it's based on the numpad. 2 is down, 4 is left, 6 is right, 8 is up, and the rest are diagonal directions.

<coordinate> is the X or Y coordinate you want him to move to. So if you have him move right (6), you would use an X coordinate.

The last number is whether or not the sprite can move through hardness, 1 being yes and 0 being no.