Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Cpt Ezz on Sat 14/06/2008 01:46:03

Title: controls
Post by: Cpt Ezz on Sat 14/06/2008 01:46:03
hi
how do i make a key on the keyboard do something like shift = jump in the game

Title: Re: controls
Post by: skuttleman on Sat 14/06/2008 01:56:26
serach for IsKeyPressed() in the help file.
Title: Re: controls
Post by: TwinMoon on Sat 14/06/2008 12:24:37
It would be easier to not use keys like SHIFT, ALT or CTRL since they don't call on_key_press.

If you want to use the space bar (space = keycode 32) add this to on_key_press (in the global script):


if (keycode==32) {
  //enter jump code here
}


(You can find all the key codes under ASCII code table in the help file)

To make a character jump you could use character.z  (.z in the help file), at least in a 'regular' adventure game. If you're making a platform game, you might change character.x and character.y directly.
Title: Re: controls
Post by: Cpt Ezz on Sun 15/06/2008 06:29:44
thank you very much