1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
readimagefile("Kepek/Battle/BattleBG_Deploy.JPG",0,0,x,y);
//Saving the background
int size=imagesize (0,0,x,y);
void* buffer1=malloc(size); //Alapkepernyo repulok nelkul
void* buffer2=malloc(size);
getimage(0,0,x,y,buffer1);
//Showing the airplanes
readimagefile("Kepek/Battle/Troops/Command_Center.GIF",535,318,659,442);
readimagefile("Kepek/Battle/Troops/Scorpion.GIF",535,463,659,587);
readimagefile("Kepek/Battle/Troops/Hellion.GIF",535,610,659,734);
readimagefile("Kepek/Battle/Troops/Cannon.GIF",535,755,659,879);
int place=0; // Number of planes deployed.
cx=-1;
cy=-1;
bool run=true;
do
{
getmouseclick(WM_LBUTTONDOWN,cx,cy);
if (cx>535 && cy>318 && cx<659 && cy<442 && place!=4) // Clicked command center
{
putimage(0,0,buffer1,0);
readimagefile("Kepek/Battle/Troops/Scorpion.GIF",535,463,659,587);
readimagefile("Kepek/Battle/Troops/Hellion.GIF",535,610,659,734);
readimagefile("Kepek/Battle/Troops/Cannon.GIF",535,755,659,879);
getimage(0,0,x,y,buffer2);
mx2=-1;
my2=-1;
do
{
mx=mousex();
my=mousey();
if (mx2!=mx || my2!=my)
{
putimage(0,0,buffer2,0);
readimagefile("Kepek/Battle/Troops/Command_Center.GIF",mx-62,my-62,mx+62,my+62);
}
|