Hi,

I'm trying to make my game playable with with a joystick, so I want to be able to press buttons with it. I am already able to press the buttons, but not everything works yet. The mouse can is moved over the screen using joy_force and I can click on it with joy_1.

The button:
Code:
PANEL* continue_pan =
{
	pos_x = 30;
	pos_y = 10;
	button(0, 0, continue_bmp, continue_bmp, continue_bmp, continu, continu_leave, continu_over);
}


The functions:
Code:
function continu()
{
	while(key_any) wait(1);
	bSuccess = game_load("my_save", 1);
	wait(-1);
}

function continu_over()
{
	while(!joy_1) wait(1);
	if(joy_1)
	{
		while(key_any) wait(1);
		bSuccess = game_load("my_save", 1);
		wait(-1);
	}
}

function continu_leave()
{
	beep();
	proc_kill((void*) continu_over);
}


continu() is used for clicking on it with the mouse, continu_over() is used for the joystick, so when the mouse moves over it, it waits for joy_1 to be pressed. But I don't want it to wait for joy_1 after the mouse leaves the button, so I use continu_leave(), but that one doesn't work. It beeps, but it doesn't end continu_over(), which I want it to do.

Anyone? frown

Last edited by Secret_V; 04/04/09 13:55.