Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Coin Flip help

Author
Message
LeoParkour
11
Years of Service
User Offline
Joined: 31st Mar 2013
Location:
Posted: 31st Mar 2013 21:11
So anyone on. I'm not receiving any errors for this but can't seem to even get pass the "press any key to continue" screen

// include the Dark GDK header file (http://forum.thegamecreators.com/?m=forum_read&i=22)
#include "DarkGDK.h"

//Global Variables
int number = -1;
const int HEADS = 0;
const int TAILS = 1;
const int spriteFlip = 3;
const int coinFlipSprite= 3;
const int headsSprite = 1;
const int tailsSprite = 1;
const int coinX = 320;
const int coinY = 240;

//Function prototypes
void setUp();
void coinToss();

// main entry point for the application
void DarkGDK ( void )
{
dbSetWindowTitle("Coin Toss");

setUp(); // The setup function.
coinToss(); //The coinToss function

dbPrint("Welcome to the coin toss. Press any key to start the game!");

//Waits for the user to press any key.
dbWaitKey();

coinToss(); //The coinToss function


// our main game loop
while ( LoopGDK ( ) )
{
//LOOP CODE HERE //


// update the contents of the screen
dbSync ( );
}

// return back to Windows
return;
}

void setUp()
{
// Load the images.
dbLoadImage("Heads.bmp", HEADS);
dbLoadImage("Tails.bmp", TAILS);

//Constant for the refresh rate.
const int REFRESH_RATE = 60;

//Seed the random number generator.
dbRandomize(dbTimer() );

//Disable auto refresh and set the refresh rate.
dbSyncOn();
dbSyncRate(REFRESH_RATE);
}


void coinToss()
{
number = dbRND(1);
}
Brendy boy
18
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 4th Apr 2013 14:06
set some brekpoints to see what is the last line that gets executed

Login to post a reply

Server time is: 2024-04-24 16:46:24
Your offset time is: 2024-04-24 16:46:24