TL;DR: I'm trying to move characters (instances in FIFE parlance?) up and down (in the z-axis), but stuck on how to do so.
I'm currently using the map and skeleton from the tutorial1c, but changed a bunch of the code from that tutorial to be more in line with the shooter demo so that I can use WASD keys for movement instead of clicking. I've got the player moving in the x/y axes with WASD well, and I'm essentially doing that using:
curloc = self.location
exactloc = curloc.getExactLayerCoordinates()
exactloc.y += 1 # SOUTH
self._statechanged = True
self._location = curloc
self._instance.move('walk', self._location, 4.0)
I want to raise/lower the skeleton/character using the E and R keys, respectively. My first (and only) thought is to essentially use the same type of system because it worked for x/y:
exactloc.z += 1 # UP
self._statechangedZ = True
self._instance.move('stand', self._location, 4.0)
with the curloc bits the same as before (it's all in the update function which I can post if desired).
This doesn't work. I'm printing exactloc to the console, and exactloc's z value does change when the E key is pressed, but reverts back to 0 as soon as it is released, like so:
What I'm looking for is a way to have the player ascend/descend. I'd prefer the result be some sort of motion in the x,y,z grid, but if it isn't possible, simulating up/down movement would also be fine I think. Any pointers?
(I do some scripting for my job, so coding isn't foreign to me, but python is - learning python is part of the reason I'm undertaking a little project and may just be missing something obvious. Thanks!)