spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

Welcome, Guest. Please login or register.
30 Jul 2010, 01:36

Home | Help | Search | Games | Wiki | Login | Register


AGS Forums  |  Using AGS  |  Modules, Plugins and Technical FAQ (Moderators: Gilbet V7000a, Scorpiorus, strazer)  |  Topic: MODULE: KeyboardMovement v1.02 « previous next »
Pages: [1] Print
Author Topic: MODULE: KeyboardMovement v1.02  (Read 3207 times)
strazer
Moderator
Member



« on: 21 Sep 2005, 01:10 »

This simple script module makes it easy to allow moving the player character using the keyboard. It is based on a-v-o's code from this thread.

Features
 * Move the player character with keyboard keys
 * Choice of two control modes: Pressing or tapping direction keys

Download here (Script module and documentation)

Ideas for future releases include key customization features and interaction functions.

Edit:

Check out the coding competition entries for modules that include interaction functions: http://americangirlscouts.org/agswiki/index.php/Coding_Contest#Keyboard_Control
« Last Edit: 30 Mar 2008, 00:38 by strazer » Logged

Pumaman
Mittician
Administrator

Member


I sense danger.


« Reply #1 on: 21 Sep 2005, 20:19 »

Good idea, having this available as a module should make things a lot easier for newbies than having to copy & paste code into their scripts Smiley
Logged
scourge
Guest
« Reply #2 on: 17 Nov 2005, 20:17 »

its not that bad, just not ideal. When the character moves he sort of lags from update to update when you continuously hold down the button. Its because of that function walkstraight(). I think Kinoko's game GOA is a good example. I think she uses your module. It doesn't move cleanly if you know what i mean.

It's not unresponsive, just a small delay between each character position update.

I downloaded the module and found the exact same lag in your module. So i went for a different approach. But i think the amount of workarounds (for the perfect smooth movement) will be huge in collision detection etc. Everything that function (walkstraight) includes.

If i can successfully achieve all those workarounds then i'll post it here, but for beginners i think you module is ideal.

Logged
Bernie
Member



« Reply #3 on: 18 Nov 2005, 13:13 »

I think the problem you describe is caused by the anti-glide mode. You could try to deactivate it and see what result you get.

Or, if for whatever reason you need a keyboard movement that works without WalkStraight(), you could try my 8-dir module:

http://www.bigbluecup.com/yabb/index.php?topic=21766.0

It acts directly on the x and y coordinates of the character and supports slow speeds as well.
« Last Edit: 20 Apr 2006, 00:37 by strazer » Logged

scourge
Guest
« Reply #4 on: 19 Nov 2005, 10:59 »

thanks bernie, turning anti-glide off fixes it. Might as well use my own movement thing now.

Your keyboard module is perfect rui and strazer, sorry.  Tongue
Logged
strazer
Moderator
Member



« Reply #5 on: 30 Mar 2008, 00:40 »

Version 1.02 now up:

- Bugfix by Rui "Trovatore" Pires: If you changed rooms, sometimes you had to double-tap on the next room in order to get the player moving again
Logged

Elessar
Member


"In the high tongue I am Elessar, the Elfstone."


« Reply #6 on: 02 May 2008, 18:31 »

Great module! Would it be possible to make it so that if you pressed two buttons (such as down & right), that the character would move on a diagonal? I know that this can be accomplished using the 1,3,7,9 buttons on the keypad, but most people that I know prefer the standard arrow keys.

P.S. The txt file still says KeyboardMovement_101.scm instead of KeyboardMovement_102.scm in section 4. Setup.
Logged
Rui 'Trovatore' Pires
Member


Lunge da lei per me non v'ha diletto!


« Reply #7 on: 02 May 2008, 20:27 »

This already happens if you set it to "Pressing". If you set it to tapping it's kind of a blind-man's-game which gets recorded - direction 1, direction 2, or the diagonal in-between. So I think we'll leave it as is. Wink
Logged

Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.
Pages: [1] Print 
AGS Forums  |  Using AGS  |  Modules, Plugins and Technical FAQ (Moderators: Gilbet V7000a, Scorpiorus, strazer)  |  Topic: MODULE: KeyboardMovement v1.02 « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.095 seconds with 17 queries.