Program a;

import "mod_blendop";
import "mod_debug";
import "mod_dir";
import "mod_draw";
import "mod_file";
import "mod_grproc";
import "mod_joy";
import "mod_key";
import "mod_map";
import "mod_math";
import "mod_mouse";
import "mod_multi";
import "mod_proc";
import "mod_rand";
import "mod_regex";
import "mod_say";
import "mod_screen";
import "mod_scroll";
import "mod_sound";
import "mod_string";
import "mod_sys";
import "mod_text";
import "mod_time";
import "mod_timers";
import "mod_video";
import "mod_wm";

Global
	graficos[2];

Begin
	set_mode(640,480,32);
	from x=1 to 2;
		graficos[x]=load_png(x+".png");
	end
	play_song(load_song("1.ogg"),0);
	timer[0]=0;
	salible();
	while(timer[0]<1500) frame; end
	x=320;
	y=240;
	loop
		size=0;
		alpha=0;
		graph=graficos[1];
		from alpha=0 to 255; size++; frame; end
		frame(2000);
		from alpha=255 to 0 step -1; size++; frame; end
		size=0;
		alpha=0;
		graph=graficos[2];
		from alpha=0 to 255; size++; frame; end
		frame(2000);
		from alpha=255 to 0 step -1; size++; frame; end		
	end
End

Process salible();
Begin
	while(!key(_esc))
		if(timer[0]>12000 and x==0) x=1; write(0,0,0,0,"LOGRO CONSEGUIDO: DERPIDERPIDERP"); end
		frame;
	end
	exit();
End