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 37 38 39 40
|
Town T(350,200,300,200);
class WaterTile
{
int x,y,sx,sy;
public:
WaterTile ()
{
sx=150;
sy=100;
out<<"Do I even Get here?\n";
while(1)
{
x=rand()%1000;
y=rand()%600;
out<<"X="<<x<<" Y="<<y<<endl;
if (T.in_town(x,y,sx,sy))
{
continue;
}
if (((sx+x)>1000)||((sy+y)>600))
{
continue;
}
break;
}
}
bool In_Tile (int xx, int yy, int ssx, int ssy)
{
if (checkhit(xx,yy,ssx,ssy,0,x,y,sx,sy,0))
{
return true;
}
return false;
}
void Draw (SDL_Surface* scr)
{
images[23]->Draw(scr,x+d_x,y+d_y);
}
};
WaterTile WT[4];
|