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 / Im a beginner

Author
Message
Tarik666
16
Years of Service
User Offline
Joined: 2nd Apr 2008
Location: Hobart
Posted: 2nd Apr 2008 19:17
What is the code for key press left then move. Is it something like

if keypress(left){

playerX-=3

}
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 2nd Apr 2008 19:43


Don't you just hate that Zotoaster guy?
Tarik666
16
Years of Service
User Offline
Joined: 2nd Apr 2008
Location: Hobart
Posted: 2nd Apr 2008 20:03
wat is wrong with this

#include "DarkGDK.h"

int playerX = 30;
int playerY = 30;

void playerupdate(void)
{
dbSyncOn ( );
dbSyncRate ( 60 );

dbLoadImage("box.bmp", 1);
dbSprite(1, playerX, playerY, 1);

if ( dbkeyState ( 203 ))
{
playerX-= 3;
}
}
ErDa
16
Years of Service
User Offline
Joined: 17th Feb 2008
Location:
Posted: 2nd Apr 2008 20:22
Should be this.

Cpt Skydiver
17
Years of Service
User Offline
Joined: 23rd Mar 2007
Location: Behind my computer?!
Posted: 2nd Apr 2008 20:29 Edited at: 2nd Apr 2008 20:30
its dbKeyState(203) instead of dbkeySate(203)

you should try to understand the debugger as it will give you the errors that are in the program and refers to where the error is located.

Tarik666
16
Years of Service
User Offline
Joined: 2nd Apr 2008
Location: Hobart
Posted: 2nd Apr 2008 20:30
Compiling...
Main.cpp
Linking...
LINK : Debug\Dark GDK - Game1.exe not found or not built by the last incremental link; performing full link
darksdk.lib(DarkSDK.obj) : error LNK2019: unresolved external symbol "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ) referenced in function _WinMain@16
Debug\Dark GDK - Game1.exe : fatal error LNK1120: 1 unresolved externals

that is the error its giving to me for my code which is

// Dark GDK - The Game Creators - www.thegamecreators.com

// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application

// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"

int playerX = 30;
int playerY = 30;

void playerupdate(void)
{
dbSyncOn ( );
dbSyncRate ( 60 );

dbLoadImage("box.bmp", 1);
dbSprite(1, playerX, playerY, 1);

if ( dbKeyState ( 203 ))
{
playerX-= 3;
}
}
Tarik666
16
Years of Service
User Offline
Joined: 2nd Apr 2008
Location: Hobart
Posted: 2nd Apr 2008 20:38
What does this error mean.

Compiling...
Main.cpp
Linking...
LINK : Debug\Dark GDK - Game1.exe not found or not built by the last incremental link; performing full link
darksdk.lib(DarkSDK.obj) : error LNK2019: unresolved external symbol "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ) referenced in function _WinMain@16
Debug\Dark GDK - Game1.exe : fatal error LNK1120: 1 unresolved externals
Tarik666
16
Years of Service
User Offline
Joined: 2nd Apr 2008
Location: Hobart
Posted: 2nd Apr 2008 21:07
what is wrong with this error

Compiling...
Main.cpp
Linking...
LINK : Debug\Dark GDK - Game1.exe not found or not built by the last incremental link; performing full link
darksdk.lib(DarkSDK.obj) : error LNK2019: unresolved external symbol "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ) referenced in function _WinMain@16
Debug\Dark GDK - Game1.exe : fatal error LNK1120: 1 unresolved externals
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 2nd Apr 2008 21:17
The main entry function should be DarkGDK(), and also you can't assign variables outside a function.

Don't you just hate that Zotoaster guy?
Cpt Skydiver
17
Years of Service
User Offline
Joined: 23rd Mar 2007
Location: Behind my computer?!
Posted: 2nd Apr 2008 21:21
which of the *wizard* templates did you use?

you should use Dark GDK - Game
that will automatically generate the code which you can start with (read the tutorials!)

Tarik666
16
Years of Service
User Offline
Joined: 2nd Apr 2008
Location: Hobart
Posted: 2nd Apr 2008 21:26
Linking...
darksdk.lib(DarkSDK.obj) : error LNK2019: unresolved external symbol "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ) referenced in function _WinMain@16
Debug\Dark GDK - Game1.exe : fatal error LNK1120: 1 unresolved externals

this is my new error for this code.

// Dark GDK - The Game Creators - www.thegamecreators.com

// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application

// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"

// the main entry point for the application is this function
void DarkGDK ( void )
{
int playerX = 30;
int playerY = 30;
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );

void playerupdate(void)
{
dbSyncOn ( );
dbSyncRate ( 60 );

dbLoadImage("box.bmp", 1);
dbSprite(1, playerX, playerY, 1);

if ( dbKeyState ( 203 ))
{
playerX-= 3;
}
}

// our main loop
while ( LoopGDK ( ) )
{
// update the screen
dbSync ( );
}

// return back to windows
return;
}
Tarik666
16
Years of Service
User Offline
Joined: 2nd Apr 2008
Location: Hobart
Posted: 2nd Apr 2008 21:53
and sorry about the bump. I am used to different forums wher your post appears automatically. I thought something wasnt working. It wont happen ahain.
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 3rd Apr 2008 02:41 Edited at: 3rd Apr 2008 02:41
Quote: "I am used to different forums wher your post appears automatically."


Your post takes awhile to appear because you just joined, so your on post-approval. This helps to somewhat limit the number of n00bs that join so they can make a team request for their 'Ub3r-l33t-u1tr4-h4lo-w0w-mmorpgfpsrts' project that they promise to share the profits of.

90% of statistics are completely inaccurate.

Login to post a reply

Server time is: 2024-10-08 03:58:10
Your offset time is: 2024-10-08 03:58:10