Hey Everyone,
I am working on a project where I need to have movement finely controlled. Basically, I have a player navigating through a city (on a grid). When the player presses forward, they need to move forward exactly one block (40 blender units.) When they press left or right, they need to turn exactly 90 degrees in the appropriate direction. This movement needs to be smooth, not instantaneous. No two moves can be simultaneous. It sounds simple enough, but it isn’t as simple as I would expect.
I figured that the best way to do this was using IPO curves. My first question is if that is, indeed, the best way?
I am having a couple of problems when using IPO curves. The first is that I can only have one IPO on my player. If I have two curves (one for, say, dLocX, and one for dRotZ), both are always played. I tried getting around that by parenting an empty to my player and having it make the dLocX movements, and the player doing the dRotZ. However, this means that after a turn, the player no longer moves forward, but on the empty’s X axis.
For now, I’m linking an example of one attempt I have done. I’ll link more if necessary based on the responses I get. I apologize in advance if some of the stuff is sloppy, but I am only a beginner with Python, and I am just learning.
http://dl.dropbox.com/u/6709999/SmallCity-OneIPO.blend I’ve tried to put in two IPO Curves on one object, and tried to use logic bricks to execute one part or another based on a key press.
Thank you for your help! If you need any more information/clarification, please let me know. I tried to keep this decently short, but descriptive.