Keyboard controls

Started by , Wed 25/01/2006 09:54:50

Previous topic - Next topic

Amber

Hello, I'd like to ask few questions. I'm planning a keyboard controlled game and I would like the character to go in the direction it faces using one arrow key, and to go back or to one side by different, but I don't know how to do it. That brings me to another problem. How can I make the character to animate backwards and going to sides without using different views?
And the last question: How can I make the character face another, even if they're both moving?
Please help.


Ashen

Perhaps the Keyboard Control Module would help?

I don't quite understand what you're asking, though - how exactly do you want the movement to work? It sounds like you want controls for forwards, step backwards and side step, and seperate controls for turn? (So that, for example, you could move up and down the screen, while still 'facing' left.) Different views might be the easiest way to do that, but would get cumbersome if it's for a lot of characters. Alternatively, use a variable, or an array, to track which direction the character should be facing, and lock the loop to that in repeatedly_execute_always. You'll also need to disable the 'Characters turn before walking' option, or enable the 'Do not turn before walking' option if it's just for a specific character.
(If I'm on the right track, let me know and I'll explain in more detail if you need it, if not - can you explain in more detail?)

The last question I think can also be solved with rep_ex_always. Using Character.FaceCharacter(..) and a bit of fiddling could work, or you could use the above method with a few changes. Again, it's in the details of how exactly you want it to behave.
I know what you're thinking ... Don't think that.

Amber

Sorry I didn't write my question detailed enough, my English...The game I'm planning will have many fights, and I want to use this there. What you writed about is exactly what I need. There will be a lot of characters in the game.What I don't know is how to run allways a different loop depending on the faced directon. The direction will be to the other character. The animation backwards could be  reversed loops, if it's possible, but for the movement sidewards I would need another 8 walk loops (maybe I'll use another view, maybe it won't be so bad)
Thank you.

SMF spam blocked by CleanTalk