globals = {
	camera = { x = 0, y=0, z=2 },
     fov = 90,
	target = { x = 0, y=1.0, z=0 },
	
-- 	camera = { x = 0, y=0, z=10 },
--     fov = 40,
--	target = { x = 0, y=5.0, z=0 },




	light0 = {   	direction = {x=-0.5, y=2.2, z=0.60 }, 
				color = {x=1, y=1, z=1}, 
			},	
	ambient = { x = 0.8, y = 0.0, z = 0.0 },
    raymarch_steps = 30,
	raymarch_shadow_steps = 4,
	up = {x=1, y=1, z=0 },
	sky = 0,
	shadow_scale = 1,
	isPaused = 0
	
}



output = {
	resolution = { width = 40, height=25},
--	resolution = { width = 320, height=200},
	aspect = 1.0,
	output_type = 1,
	c64_multicolor = 0,
	c64_imageType = 0,
	dither = 2,
	ditherStrength = { x = 0, y= 1, z= 1},

--	c64_colors = { 0,5,14,6 }
	index_colors = { 0,0,0,6 }
}


--noFrames = 24
noFrames = 140
frame = 0

MaterialBlue = {
   color = { x=1, y=1, z=1 },
	reflection = 0.0,
	shininess = 50,
	shininess_intensity = 0 
}


function Init()

	--	AddObject("box","b0","","MaterialBlue",0,0,0,  1,1,1);

---	DeleteFile("data/santa_color_in.ras")

end

function UpdateScene();


	

end


function PostProcess();
	
	if (frame>noFrames+1) then 
		return;
	end
	s = 30/(math.pow(frame,1.65))

	sx = 20*s
	sy = 20*s
	rot = -frame/120.0+1.2
--	whoo("")
	DrawImage("grim_reaper/hat1.png",
	output.resolution.width/2*0+10, output.resolution.height/2*0, 
	sx,sy, 
	rot) 

-- 	DrawCircle(50,50, 50,80,128,0,0)
 
end

function Update()
	
	if (frame<noFrames) then 
		
		UpdateScreenDataFrame(0,0,40,25,frame+80)

	end
	if (frame==noFrames) then
	
--		SaveScreenAndCharset("data/tree_screen.bin","data/removeme.bin")
--		SaveScreenAndCharset("data/fadein_pumpkin_screen.bin","data/removeme.bin")
		SaveScreenAndCharset("data/fadein_hat_screen.bin","data/removeme.bin")
		Message("DONE! You can close this window now");
	end

	
		UpdateScene()



	frame=frame+1
	

end
