Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: JackAnimated on Sun 17/08/2014 20:40:51

Title: Changing code for top down control. Walkable areas
Post by: JackAnimated on Sun 17/08/2014 20:40:51
Changing code for top down control.

At the moment AGS is set up for side control. Meaning walkable areas define where a sprites feet may walk. I am creating a top-down view game and so want the walkable areas to restrain where the entire sprite may walk/may not walk. At the moment my sprite overlaps area I do not wish them to tread.

I think the script needs to be edited, probably somewhere about setting the point of feet on a character. Any pointers?


Many thanks.
Title: Re: Changing code for top down control. Walkable areas
Post by: Khris on Sun 17/08/2014 22:13:36
You can shift where a character is drawn in relation to their pivot by giving them a negative z-value:
Code (ags) Select
// in game_start()
  player.z = -30;  // 30 pixels down

Just use half the height of your sprite and it should center nicely.
Title: Re: Changing code for top down control. Walkable areas
Post by: JackAnimated on Sun 17/08/2014 22:38:42
Thanks. Worked a treat.