Using the Arrow keys Instead of the mouse...

Started by The Almighty Metroid, Sat 28/02/2009 20:25:07

Previous topic - Next topic

The Almighty Metroid

*clears throat* Hello AGS community! As you can tell by the title I need help making AGS use the arrow keys instead of the mouse...

I know if I do it one way it'll make the playable person move until another key is pressed.

What i need to know is how do I script it to where you press the arrow key for 2 seconds the character moves for 2 seconds (did that make sence?)
Who is more foolish? The fool, or the fool that follows him?

Ghost

#1
If you are using a recent version of AGS, the Default Game template already deals with keyboard movement, so you don't need to script too much on your own. The code in Keyboard_movement_102 is pretty simple, and all you need to do is change "movement tapping" to "movement pressing". (Tapping means the player walks into a direction until he hits something/another key is pressed)

The Almighty Metroid

Thanks ill try that.. ill notify of resutls!
Who is more foolish? The fool, or the fool that follows him?

The Almighty Metroid

#3
my results are... Where can i find that.. is it in .asc or .ash?
Who is more foolish? The fool, or the fool that follows him?

Ghost

#4
Quote from: The Almighty Metroid on Sat 28/02/2009 21:51:28
my results are... Where can i find that.. is it in .asc or .ash?

asc. ash are always header files (like in C/C++), where stuff gets defined.

Edit: My bad, sorry. It's in the global script (still asc), in game_start:

Code: ags

function game_start() {   
  // Put the code all in a function and then just call the function. 
  // It saves cluttering up places like game_start.
  initialize_control_panel(); 
  // Use the KeyboardMovement module to, per default, replicate the standard
  // keyboard movement of most Sierra games. See KeyboardMovement.txt for more info
  KeyboardMovement.SetMode(eKeyboardMovement_Tapping); 
}


Just set the mode there, in the last line.

SMF spam blocked by CleanTalk