

var video_screen=1;
var video_mode=7;

function health_func();

string vase=<vase_rot+15.tga>;// our health entity

function main()
{
	mouse_pointer=0; // dont show the mousepointer if using sed
	level_load("health_test.wmb");
	sky_color.red=1;
	sky_color.green=1;
	sky_color.blue=1;
	wait(3);
	
	ent_create(vase,nullvector,health_func);
	//create the health entity like normal entitys
}


function health_func()
{
	my.facing=on;
	my.scale_y=0.05;// scale it down , so you can use it very close to the camera
	my.scale_x=my.scale_y;
	my.passable=on; //no colission needed
	while(1)
	{
		proc_late(); // change pos. smoothly , not shaking around
		temp.x=750;
		temp.y=540;// 2D screen coordinates
		temp.z=30;
		vec_for_screen(temp,camera); // get the 3D world coordinates
		vec_set(my.x,temp); // move the health entity to the 3D coordiantes
		if(mouse_left==1)&&(my.frame<15){my.frame+=0.3*time_step;}
		if(mouse_right==1)&&(my.frame>1){my.frame-=0.3*time_step;}
		wait(1);
	}
}