mob
verb
stepright()
set hidden = 1
Move(get_step(src,EAST),usr.dir)
Problem description:
this lets me side step one tile,but i want it to work like the arrow keys in that you keep moving while key is held down. how can i make that happen?
ID:2412271
Nov 20 2018, 3:05 pm
|
|
Code:
mob Problem description: this lets me side step one tile,but i want it to work like the arrow keys in that you keep moving while key is held down. how can i make that happen? |
Then you'd set macros up that do something like call "KeyDown [key]" and "KeyUp [key]", you can do this with the "Any" macro, which lets you capture all key press and release events, but it does generate a little more overhead than just having macros for what you need.
In this example you'd be passing a number (direction) to the verb, but if you used the Any macro you'd need to handle them as strings and do some conversion.
(This was written off the top of my head and is to be taken as an example, not working code)