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.
Last edited by sadsack; 10/07/08 19:28.