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()
followed by
elif self._scene.keystate['S']:
exactloc.y += 1 # SOUTH
self._statechanged = True
followed by
curloc.setExactLayerCoordinates(exactloc)
self._location = curloc
followed by
if self._statechanged:
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:
elif self._scene.keystate['E']:
exactloc.z += 1 # UP
self._statechangedZ = True
followed by
if self._statechangedZ:
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:
DoublePoint3D(0:1:1)
DoublePoint3D(0:1:0)
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!)