Okey aersixb9 your code work but I continued programing my game and got another error. Here is my code:
// Main Header Files
#include "DarkGDK.h"
// Defining all Sub areas of game
void game ( void );
void loadmedia ( void );
void inkey ( void );
void DarkGDK ( void )
{
// Defining Variables
int px, py, ex, ey, w1x, w2x, right, left;
px = 350;
py = 550;
right = 0;
left = 0;
// Turning Sync On and Setting it to 0
dbSyncOn ( );
dbSyncRate ( 0 );
// Setting the display mode to 800 x 600
dbSetDisplayMode ( 800, 600, 32 );
// Telling it to load all of the media
loadmedia ();
// Telling The Computer to paste you to the screen
dbSprite ( 1, px, py, 1 );
// Our Main Loop
while ( LoopGDK ( ) )
{
game();
dbSync ( );
}
// return back to windows
return;
}
void game ( void )
{
inkey();
dbSprite ( 1, px, py, 1 );
dbSync ();
}
void loadmedia ( void )
{
dbLoadImage ( "you.png", 1 );
}
void inkey ( void )
{
if ( dbRightKey ())
{
px += 2;
}
if ( dbLeftKey ())
{
px -= 2;
}
}
Here is my error:
------ Build started: Project: Dark GDK - Game1, Configuration: Debug Win32 ------
Compiling...
Main.cpp
c:\documents and settings\parent\my documents\visual studio 2008\projects\dark gdk - game1\dark gdk - game1\main.cpp(51) : error C2065: 'px' : undeclared identifier
c:\documents and settings\parent\my documents\visual studio 2008\projects\dark gdk - game1\dark gdk - game1\main.cpp(51) : error C2065: 'py' : undeclared identifier
c:\documents and settings\parent\my documents\visual studio 2008\projects\dark gdk - game1\dark gdk - game1\main.cpp(66) : error C2065: 'px' : undeclared identifier
c:\documents and settings\parent\my documents\visual studio 2008\projects\dark gdk - game1\dark gdk - game1\main.cpp(71) : error C2065: 'px' : undeclared identifier
Build log was saved at "file://c:\Documents and Settings\Parent\My Documents\Visual Studio 2008\Projects\Dark GDK - Game1\Dark GDK - Game1\Debug\BuildLog.htm"
Dark GDK - Game1 - 4 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========