i've got a problem on how do i use dbRnd in my 2d game...i was creating a target game ... using 2 image... i want the first object moving horizontaly at RANDOM speed and RANDOM Y axis...that was the target,,, and the 2nd image was only moving upward,,, to ht the target that move randomly.. how do i code that.
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbLoadImage("asteroids.png",1);
dbSprite(1,200,0,1);
while ( LoopGDK ( ) )
{
dbMoveSprite(1,-1);
if(dbSpriteY(1)>450)
{
dbSprite(1,200,0,1);
}
dbSync ( );
}
return;
}
this is my code.. how do i code that the balloon was on its random Y axis and random velocity?? it creat random after the if statement granted.