here is my player panel code. The bmap changes based on direction of the keyboard.

Code:
function player_startup()
{
	VECTOR player_speed;
	var horizontal_speed = 0;
	var vertical_speed = 0;
	player_pan = pan_create("bmap = player.png", 150);
	player_pan.pos_x = 75;
	player_pan.pos_y = 158;
	player_pan.flags |= VISIBLE;
	player_pan.center_x = player_pan.size_x * 1; // set the rotation point for the panel
	player_pan.center_y = player_pan.size_y; // at its center on the x and at its bottom at its y axis
	while (1)
	{
		vec_set(player_speed.x, accelerate (horizontal_speed, 3 * (key_cur - key_cul), 0.3)); // 2 gives the acceleration, 0.3 the friction
		player_pan.pos_x += player_speed.x;
		vec_set(player_speed.y, accelerate (vertical_speed, 3 * (key_cud - key_cuu), 0.3)); // 2 gives the acceleration, 0.3 the friction
		player_pan.pos_y += player_speed.y;
		
		if (key_cul + key_cur + key_cuu + key_cud)
		{
			player_pan.angle += 0.8 * sin(60 * total_ticks);
		
			if (key_cul)
			{
				player_pan.bmap = player_left;
			}
			
			if (key_cur)
			{
				player_pan.bmap = player_right;
			}
			
			if (key_cuu)
			{
				player_pan.bmap = player_up;
			}
			
			if (key_cud)
			{
				player_pan.bmap = player_down;
			}
		}
			
			else
			{
				player_pan.bmap = player_center;
				player_pan.angle = 0;
			}
		
		wait (1);
	}
}



And here is my weapon panel code so far. It just disapears once the player gets close to the object then in another panel it shows that the weapon is equipped. But is not yet attached to the player.

Code:
function weapon_startup()
{
	VECTOR weapon_pos;
	 	weapon_pan = pan_create("bmap = skilletright1.png", 150);
		weapon_pan.pos_x = 125;
		weapon_pan.pos_y = 320;
		weapon_pan.flags |= VISIBLE;
	   while ((abs(player_pan.pos_x - weapon_pan.pos_x) > 40) || (abs(player_pan.pos_y - weapon_pan.pos_y) > 40))
	   {
	           wait (1);
	   }
	   
	   weapon_equip_pan.bmap = skillet_Right1;
	   ptr_remove(weapon_pan); // remove the weapon once picked up.
	   wait (1);
}



Thanks for the help grin

Last edited by Crazykins; 10/19/09 23:22.