Ok so i am trying to write a/am if statement to set a random X,Y position for a sprite
here is what i have (I'm very noobish with codeing) am i going about it the right way
here is my function for DRAW
Sprite_Draw_Frame(explosion, posx,posy, frame, 128, 128, 6);
here is the function
void Sprite_Draw_Frame(LPDIRECT3DTEXTURE9 texture, int destx, int desty, int framenum, int framew, int frameh, int columns)
{
D3DXVECTOR3 position( (float)destx, (float)desty, 0 );
D3DCOLOR white = D3DCOLOR_XRGB(255,255,255);
RECT rect;
rect.left = (framenum % columns) * framew;
rect.top = (framenum / columns) * frameh;
rect.right = rect.left + framew;
rect.bottom = rect.top + frameh;
spriteobj->Draw( texture, &rect, NULL, &position, white);
}
and here is what im trying (not so well) to use to change the var's for pos and posy
if (frame==0)
{
posx = (int)srand(time);
posy = (int)srand(time);
}