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 / Class Help - 2D Game

Author
Message
Thorope
13
Years of Service
User Offline
Joined: 9th Jan 2011
Location:
Posted: 9th Jan 2011 17:07
Im a new to C++ and Dark GDK and am creating a 2D Tile based Zelda like game, it is only for the purpose of improving my skills, but i have become stuck as when ever i add code to classes the compile won't run as it should, i know this means something is wrong with the code, but i just dont know how to fix it, ive been following a tuto on youtube, with the same layout but i just cant fix it, can any one help me fix my code. if you don't understand part of my code please ask and i will try to explain.


here is the Main.cpp and PlayerMain.Cpp + .h


Main.cpp


PlayerMain.cpp


PlayerMain.h



I hope you can help.

Life is like code, you write it and it happends.
Cetobasilius
14
Years of Service
User Offline
Joined: 29th Dec 2009
Location: Mexico
Posted: 9th Jan 2011 20:10
the problem must be that you have the void DarkGDK(void)and loopgdk inside player.cpp and there is no need for that to return a zero. you can make PlayerMain::movement() void, not int, oh well, you might not be using the best aproach to make your game, why dont you try making your game with structured programming first?

hi
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 10th Jan 2011 00:16 Edited at: 10th Jan 2011 00:18
Your class h file is correct but I noticed a missing "}" in the int PlayerMain::movement() function from that class.

Start everything off from your template that the GDK gives you and just include the headers to get the classes compiled correctly.

Warning! May contain Nuts!

Login to post a reply

Server time is: 2024-06-28 01:07:49
Your offset time is: 2024-06-28 01:07:49