Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: JennaAbbott on Wed 20/05/2009 12:13:15

Title: How do I make it so that my char only moves left and right with the arrow keys?
Post by: JennaAbbott on Wed 20/05/2009 12:13:15
I only want my character to move left and right, and to be controlled by the arrow keys.
Also I want to know how to make a default action (look, pick up etc) so the action will be carried out by double clicking on the object. :) Thanks
Title: Re: How do I make it so that my char only moves left and right with the arrow keys?
Post by: Khris on Wed 20/05/2009 13:09:39
The first thing can be achieved easily by using and adjusting the built-in keyboard movement module.
At the beginning of its rep_ex, there's a block where the module checks for keypresses. Simply remove all the other directions.

Implementing a default action can be done using Custom Properties.
In the global on_mouse_click, get the object under the mouse cursor, read its default action stored in the property, then call ProcessClick using an appropriate cursor mode.