Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Hedge on Sat 29/06/2013 23:26:17

Title: [solved] Can the character not center itself at the clicked place?
Post by: Hedge on Sat 29/06/2013 23:26:17
I am trying to create a game which would be kept in the style of shadow theater. So every character, object etc.  would  be on a stick:
(http://i.imgur.com/AzjQKVa.png) -here you can se girl on a stick. In order to make a character on a  stick I just made a  relatively high strip of which half is the character and half is  the stick.

The problem is that the character want to center itself on the point that it is walking to therfore (http://i.imgur.com/OgHUAVj.png) and once it centers itself at the point it cannot go down - to the bottom of the walkable area, no matter where you click the character would be at the top of walkable area.

I hope that my explanation of my problem is clear enough. So muy question is whether it is possible to make tch character  not to center at the poin to which it is walking?


I tried to modify global script
Code (AGS) Select
function on_mouse_click(MouseButton button) {
  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
  }
  else if (button == eMouseLeft) {
    ProcessClick(mouse.x, mouse.y+60 , mouse.Mode );


then the problem of  walking dissapears but now I have to click 60px above object to interact with it.

Can someone help?
Title: Re: Can the character not center itself at the clicked place?
Post by: Khris on Sat 29/06/2013 23:37:41
Just put this inside game_start:
Code (ags) Select
  player.z = -60;

AGS will draw the player sprite 60 pixels further down without changing their position in the game world.

(And of course you need to undo the change you made.)
Title: Re: Can the character not center itself at the clicked place?
Post by: Hedge on Sat 29/06/2013 23:47:43
Thx, that exactly it