Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Jimmy on Fri 16/01/2004 02:57:27

Title: How do you move a object?
Post by: Jimmy on Fri 16/01/2004 02:57:27
How do you move a object without making the game busy?
Title: Re:How do you move a object?
Post by: Wolfgang Abenteuer on Fri 16/01/2004 05:04:20
MoveObject and MoveObjectDirect are both non-blocking functions.  Was there something else you needed it to do?  ???

~Wolfgang
Title: Re:How do you move a object?
Post by: Jimmy on Sat 17/01/2004 01:54:38
sorry. how do you move a CHARACTER.
Title: Re:How do you move a object?
Post by: Wolfgang Abenteuer on Sat 17/01/2004 02:34:52
MoveCharacter, MoveCharacterDirect, and MoveCharacterPath are also non-blocking.

~Wolfgang
Title: Re:How do you move a object?
Post by: Jimmy on Sat 17/01/2004 03:53:16
But it blocks for me...
Title: Re:How do you move a object?
Post by: Wolfgang Abenteuer on Sat 17/01/2004 04:00:40
Uh...it shouldn't.  MoveCharacterBlocking should be the only one that blocks.  By "blocking", you mean the game changes to the Wait cursor and you can't do any interactions, right?  Are you trying to move the player character or someone else?

~Wolfgang
Title: Re:How do you move a object?
Post by: Ishmael on Sat 17/01/2004 12:43:15


MoveObject
MoveObject (int object, int x, int y, int speed)

Starts the object OBJECT moving from its current location to (X,Y). It will move at speed SPEED, which uses the same scale as the character Walk Speed values in the Room Editor.
Example:

MoveObject(2,125,40,4);
while (IsObjectMoving(2)==1) Wait(1);

will move object 2 to 125,40 and return control to the player when the object gets there.




It shouldn't block, unless ou have used the specific code used as example in the manual.