Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Morgan on Mon 27/09/2004 23:23:45

Title: Kind of like board game movement
Post by: Morgan on Mon 27/09/2004 23:23:45
I want my character to move like so:
(http://www.2dadventure.com/ags/like-this.gif)

How do I go about doing this? and how do I turn the down and up movements into left/up and right/down or just use/left up and right/down and somehow turn up and down off?
Title: Re: Kind of like board game movement
Post by: BorisZ on Mon 27/09/2004 23:42:40
It looks like it's gonna need some arrays. I am not sure, but I think you can use arrays in AGS (chack manual).
Title: Re: Kind of like board game movement
Post by: TerranRich on Tue 28/09/2004 03:24:28
Yes, a two-dimensonal array. Check the Technical Archive for help on this.

Basically, the first dimension on the array would be "X", and would store each X-value coordinate from top to bottom. The second dimension ("Y") would store each Y-value coordinate from left to right.
Title: Re: Kind of like board game movement
Post by: Radiant on Tue 28/09/2004 13:17:33
How about using keyboard control, that'd make it easy.

Also, ditch the standard movement routines and put your own in...
in handle_mouse_click, set dest_x and dest_y to the spot the player clicked on.
In rep_exec, move the player closer to that position. Ta dah!