## moveCharacter

### Syntax:

    moveCharacter (thisCharacter, sX, sY);

    moveCharacter (thisCharacter, thisObject);

### Purpose:

Walks thisCharacter to a new location on the screen, following any floor which setFloor has currently set. The execution of the program will continue when the character reaches its desired destination or as close to the destination as the floor will allow. If the location lies outside of the current floor, the position to which the character will actually walk is the closest point on any of the floor borders. If the character is not inside the floor area when the function is called, it will be moved around the floor as if it were starting in the nearest section to its current position.

If the function call provides three parameters, the second and third parameters are assumed to be the co-ordinates of the new position (sX, sY).

If the function call provides only two parameters, the second is assumed to be an object thisObject which is already represented by a region on the screen using the addScreenRegion command. If this is the case, upon arrival at the new location the character will turn to face the direction specified in the addScreenRegion call (unless this has been set to -1).

In either of these cases, if the final co-ordinates to which the character is told to walk are (0, 0) the character will not move.

### Return value:

No return value.

### See also:

Object Types as Characters

addCharacter

forceCharacter

isMoving

jumpCharacter

setCharacterWalkSpeed

SLUDGE and this SLUDGE documentation are copyright Hungry Software and contributors 2000-2012