Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Move character with arrows  (Read 2962 times)

0 Members and 1 Guest are viewing this topic.

renno

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
  • I'm a llama!
    • View Profile
Move character with arrows
« on: February 09, 2004, 06:30:29 PM »

hello everyone.
how can i move my character with arrows instead of the mouse pointer?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Move character with arrows
« Reply #1 on: February 09, 2004, 09:36:20 PM »

Well, it won't be easy, you'd have to check the

on "keypress" ...

event and send the actor to appripritae directions, like:

if(Keyboard.KeyCode==VK_RIGHT) actor.GoTo(actor.X + 50, actor.Y);
...

But since there's no event for key-release, you'd have to periodically check for the "keypress" events to know it the key is being hold down.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:Move character with arrows
« Reply #2 on: February 13, 2004, 04:59:37 PM »

Quote
But since there's no event for key-release

This sounds like a self-made feature reguest. ;)
Logged
fl*p
 

Page created in 0.036 seconds with 19 queries.