I'm having difficulty creating random Green Balloons that appear along the Y axis and move from right to left. I've included the just this particuliar function of the game in hopes of narrowing down the possible errors.
Thanks for any help.

Inline Code Example Here
// This program simulates a green balloon appearing randomly
// and moving horizontally.

include "DarkGDK.h"

// Constants
const int GREEN_BALLOON_IMAGE = 1;
const int REFRESH_RATE = 60;
const int X_MOVEMENT = 10;
const int distance = 10;

// Function prototype
void moveGreenBalloon();

// DarkGDK function *
void DarkGDK()
// Variables
int greenBalloonX, greenBalloonY;

// Perform setup operations.


// Calculate the maximum Y coordinate for
// the greenBalloon sprite.
int maxY = dbScreenHeight() - 

// Game loop
while ( LoopGDK() )

    // Random Green Balloons



// The setUp function performs setup operations. *
void moveGreenBalloon(int & GreenBalloonY)
// Set the key color.
dbSetImageColorKey(0, 255, 0);

// Load the ball image.
dbLoadImage("greenBalloon.bmp", GREEN_BALLOON_IMAGE);

// Calculate the ball's X coordinate so we can
// place the ball at the right edge of the screen.
int greenBalloonX = dbScreenWidth() -

// The ball's Y coordinate is 0.
dbRandomize( dbTimer() );
int greenBalloonY = dbRND(dbScreenHeight()-
                    dbSpriteHeight(GREEN_BALLOON_SPRITE) );

// Create the ball sprite.
dbSprite(GREEN_BALLOON_SPRITE, greenBalloonX, greenBalloonY, GREEN_BALLOON_IMAGE);

// Disable auto refresh and set the maximum
// refresh rate.


Hi, So what is the actual problem? I have never used DarkGDK before, but if you let us know what is happening/what you expect to happen, we can easily let you know if your theory is off.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.