Moving the character outside of screen edge

Started by , Sun 06/07/2003 20:34:13

Previous topic - Next topic

JLM

How can I make my character walk outside of screen (like in games for example Kings Quest 2 remake)?

If the player clicks the edge of screen (with "walk to"-icon) the character walks there, of course, but he always stops before the room changes.  I would like to make a script that moves character over the screen edge before the room has changed. I have tried to use for example command "MoveCharacher(EGO, 350, 150);" with 320x200 room, but the character stops already when he is at x-coordinate 300.
What can I do?

Wolfgang Abenteuer

You'll need to use MoveCharacterDirect, since if you're walking off of the actual screen edge you're going into "non-walkable" areas of the screen.  On the "walk off screen edge" for whichever side you're trying to make (I'll use the right side as an example), put a command like MoveCharacterBlocking (EGO, 335, 190, 1), so that as soon as he hits the screen edge, he'll walk to x335 (15 pixels off the right side of the screen), y190 (assuming you're walking off of the bottom right corner of the screen), ignoring walkable areas.  Also make sure that you have the screen edge set on a walkable area or the character won't be able to reach it.

~Wolfgang

SMF spam blocked by CleanTalk