- commit
- 31eb52a482d14cc1299f20f2d2b1b1fd0fdb9ee5
- parent
- 30df63e6dca37e01cc852a012086236068d6836d
- Author
- Tobias Bengfort <tobias.bengfort@gmx.net>
- Date
- 2014-10-05 10:03
define move and position actions
Diffstat
| M | laneya/actions.py | 22 | ++++++++++++++++++++++ |
1 files changed, 22 insertions, 0 deletions
diff --git a/laneya/actions.py b/laneya/actions.py
@@ -14,3 +14,25 @@ def echo(foo=''): 14 14 15 15 def other(foo=''): 16 16 """Example client action.""" -1 17 -1 18 -1 19 def move(direction=None): -1 20 """Start moving in the defined direction. -1 21 -1 22 This message is primarily useful for clients that want to move their users -1 23 on the map. They can easily convert key press events to ``move`` -1 24 messages. -1 25 -1 26 I might be worth to also broadcast these messages so clients can -1 27 interpolate a user's movement. ``move`` messages are however not fit to -1 28 handle the actual movement of entities because clients may run with -1 29 different speeds. The ``position`` message should be used instead. -1 30 -1 31 """ -1 32 assert direction in ['north', 'east', 'south', 'west', 'stop'] -1 33 -1 34 -1 35 def position(x=None, y=None, entity=None): -1 36 """Set an entities position.""" -1 37 assert isinstance(x, int) -1 38 assert isinstance(y, int)