var video_mode = 8;
var video_depth = 32;

string level_1 = <tutorial.wmb>;

bmap flame = <flame_2.bmp>;
bmap splashmap = <logolite.pcx>;

panel splashscreen { bmap = splashmap; flags refresh, d3d; }

function flame_1();
function flame_2();

function main()
{
	on_d = null;
	fps_max = 80;
	fps_min = 16;
	tex_share = on;
	splashscreen.pos_x = (screen_size.x - bmap_width(splashmap))/2;
	splashscreen.pos_y = (screen_size.y - bmap_height(splashmap))/2;
	splashscreen.visible = on;
	wait(3);
	level_load(level_1);
	sleep(1);
	splashscreen.visible = off;
	bmap_purge(splashmap);
}

starter test_cam
{
	while(1) {
		camera.x = -200;
		camera.y = 0;
		camera.z = 64;
		camera.pan += 2 * time;
		camera.tilt = 0;
		camera.roll = 0;
		vec_rotate(camera.x, camera.pan);
		wait(1);
	}
}

action fire
{
	my.passable = on;
	my.invisible = on;
	while(1){
		effect(flame_1,3,my.x,nullvector);
		waitt(1);
	}
}

function flame_1()
{
	my.x += random(16) - 8;
	my.y += random(16) - 8;
	my.z += random(16) - 8;
	my.bmap = flame;
	my.size = random(20) + 20;
	my.lifespan = 32;
	my.flare = on;
	my.alpha = 0;
	my.bright = on;
	my.skill_a = -100;
	my.gravity = -0.2;
	my.move = on;
	my.function = flame_2;
}

function flame_2()
{
	my.skill_a += 6 * time;
	my.alpha = 100 - abs(my.skill_a);
	my.size -= 0.3 * time;
}