Reply to Re: Sp_dir question
If you don't have an account, just leave the password field blank.
Make a global called &last_map. Then place on the adjoining four screens a sprite with the following script:
void main(void)
{
&last_map = &player_map;
}
Then on the screen with the knight:
void main(void)
{
if (&last_map == xyz)
{
//screen north
sp_dir(&sprite, 8);
}
if (&last_map == xyz)
{
//screen east
sp_dir(&sprite, 6);
}
if (&last_map == xyz)
{
//screen south
sp_dir(&sprite, 2);
}
if (&last_map == xyz)
{
//screen west
sp_dir(&sprite, 4);
}
//other code
}
Where xyz are the numbers of the four adjoining screens. Of course, the number of the screen north should be placed in the if statement of the northern screen.
void main(void)
{
&last_map = &player_map;
}
Then on the screen with the knight:
void main(void)
{
if (&last_map == xyz)
{
//screen north
sp_dir(&sprite, 8);
}
if (&last_map == xyz)
{
//screen east
sp_dir(&sprite, 6);
}
if (&last_map == xyz)
{
//screen south
sp_dir(&sprite, 2);
}
if (&last_map == xyz)
{
//screen west
sp_dir(&sprite, 4);
}
//other code
}
Where xyz are the numbers of the four adjoining screens. Of course, the number of the screen north should be placed in the if statement of the northern screen.