'Ello, again
Sorry to bother everyone (again), but I’m having another problem …
Before I start though, if anybody knows a place (web page, wiki, etc.) where I can learn more about the Blender GE, please post that, it just seems I don’t know enough about Blender (or it’s GE…) to be making this kind of game, but I find it difficult to locate the proper resources online, which I usually tend to do before asking a question about it (like when I was learning C++, there were looots of resources on it online, making it [usually] easy to figure out how to do something).
Okey on to my issue: Typically when anyone in real life is turning… oh how about left, they don’t stop in place and begin rotating in place until they’ve turned left and then begin walking again, they just turn left and start walking. I wanted that in my game, but I didn’t know how to do it at first. I tried making a new Integer, where different values meant different directions (0=forward, 1=forward/left, 2=left, 3=backwards/left, etc. etc…), and did a little research to learn how expressions work in this case (I had tried different varitions of writing out an if() statement, but it turned out I didn’t even need the word ‘if’ in there, lol). Then I turned on my common sense and decided a string would be easier to use, so I changed it to that.
So at first the string is equal to “forward”, but if you press the ‘LEFT’ key on the D-Pad, I want the player to be rotated the proper amount, the Direction property be equal to “left”, and for as long as the player is holding down the left key, the charafter is moving left (although technically forward, just has been rotated 90 degrees counter-clockwise). I ended up with a complex setup, where if you press the left key like 3 or more things happening at once, including idle being equal to false, walking (another property) being equal to true, the character rotating once, and then then the character begins walking forward. I got confused, real quick. Is there an simpler way to do this, or is this basically how I have to do it?
P.S. if I could use python to make the character simply rotate to forward (0 degrees), forward/right (45 degrees), right (90 degrees), etc. depending on what key/keys are pressed, I would MUCH rather use that instead, so if you know how to do something like this using Python, please say so. Of course you don’t have to actually give me the code, just do what my friends at Rohitab do (lol…): give me some hints, maybe a few functions I might not know, and I look up the rest
Thanks for reading, hope someone can help