To my surprise I actually did it first try, works perfect thanks a lot. Heres the source for the button and function.

Code:
 
        button ( 325, 300, easy_roll, easy_norm, easy_roll, set_difficulty(), NULL, NULL);
	button ( 325, 350, medium_roll, medium_norm, medium_roll, set_difficulty(), NULL, NULL);
	button ( 325, 400, hard_roll, hard_norm, hard_roll, set_difficulty(), NULL, NULL);
	button ( 325, 450, impossible_roll, impossible_norm, impossible_roll, set_difficulty(), NULL, NULL);

function set_difficulty ( button_number, panel)
{
	start_pan.visible = OFF;
	if(button_number == 1)
	{
		computer_speed = 2;
		ball_speed = 1;
	}
	if(button_number == 2)
	{
		computer_speed = 4;
		ball_speed = 2;
	}
	if(button_number == 3)
	{
		computer_speed = 6;
		ball_speed = 3;
	}
	if(button_number == 4)
	{
		computer_speed = 10;
		ball_speed = 5;
	}
	player_pan.visible = ON;
	controls_pan.visible = OFF;
}



This saved me only about 9 lines but I was only using 4 buttons and my code is a lot more readable I think, even though i didn't add any comments smile.

edit: I was also wondering if there is some way to reset the game so to speak? Once the game ends I want you to play it again, and I am doing this by resetting all the vars to there default values and going back to the first panel but there are some issues with this that I cant seem to fix. Is there some restart_game function lol.

Last edited by halfpint; 02/21/09 23:39.