help with change movemode

Posted By: Schloder87

help with change movemode - 10/07/08 13:43

i got a problem with my movemodes

how is it possible that i can switch movemodes by 1-5?

i started with that:

function select_movemode()
{
playerIntentions_boxing();

if (Key_Pressed(action2_key_scancode)==on)
{
playerIntentions_onehandsword();





}

but it only works, if i stay on action2_key...
Posted By: sadsack

Re: help with change movemode - 10/07/08 19:24

I don't know if this will help, but if you want to stay in that function untill you press another key to go to a nother function like function fight_with_ax()
I would try this. You must have while loops in you functions to stay in them.

var sword_1hand = 1;

var axfight = 1

then something like this in the while loop

if (sword_1hand = 1)
{playerIntentions_onehandsword();}
if (axfight = 0)
{fight_with_ax()}

if(key_a){sword_1hand = 1;}
if(key_b){axfight = 0;}

Now at the bottom of your code put your functions

function playerIntentions_onehandsword()
{
code goes here.

}

function fight_with_ax()

{
code goes here

}

Now this is very simple so you are going to have some more stuff.
don't for get to declare your functions.
renny

EDIT: oh yes, if you have a loop in your function, make sure you have a way to get out of it when you want.
© 2024 lite-C Forums