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 / Can Anyone Help???

Author
Message
Cooldude
17
Years of Service
User Offline
Joined: 10th Nov 2007
Location:
Posted: 10th Dec 2007 21:00
Hey,
I saw in the Dark Dungeons tutorial they would like say game() and it would go to the void game ( void ) thing. When I try ta do that it says that game is undefined. Why??? Here is my code:

aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 10th Dec 2007 21:18 Edited at: 10th Dec 2007 21:18
Yay! I know this one. Predefine your functions you must! That is to say:

Deagle
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Finland
Posted: 10th Dec 2007 21:42
Or, if you don't want to declare the functions, you can just code them before the main function:



Deagle aka D-Eagle
Cooldude
17
Years of Service
User Offline
Joined: 10th Nov 2007
Location:
Posted: 10th Dec 2007 22:12
Okey aersixb9 your code work but I continued programing my game and got another error. Here is my code:



Here is my error:
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 10th Dec 2007 22:27
Have a guess what the errors mean...

It means the identifiers 'px' and 'py' aren't declared when you try to modify them at the specified lines. They are local only to the 'DarkGDK' function, so declare them in the global scope (outside of any function) and it'll work fine.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Cooldude
17
Years of Service
User Offline
Joined: 10th Nov 2007
Location:
Posted: 11th Dec 2007 01:05
Ok, I got my variables working now i'm working on making a sprite stop when it hits a certain point but it won't work!!
Can anyone point out what is wrong with my code???

Cooldude
17
Years of Service
User Offline
Joined: 10th Nov 2007
Location:
Posted: 11th Dec 2007 01:06
LOL!!!
I made a dumb mistake and I fixed it now!!!
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 11th Dec 2007 04:00
You may want to consider learning some more basic C++ before continuing. DarkBASIC was, naturally, a BASIC language, not similar at all to C++. Beyond heavy syntax differences, there are many concept differences as well, especially considering that C++ is Object Oriented while DB was not.

Head over to http://www.cplusplus.com/doc/tutorial/ which might give you the basics of the language.

Cheers,
Bishop


Tux is my guildmaster.
aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 11th Dec 2007 06:45
C++ isn't necessarily object oriented. I hate it when people use C++ features excessively, instead of using them sparingly to make the code cleaner/easier to read/write. DGDK is mostly C-like, and I would encourage everyone to use c-like programming style with C++ OO used sparingly, unless of course you're doing a purely OO design. In which case you can use C++ OO style...

As far as ease of use APIs, I would say that DGDK is one of the easiest to use APIs that I've ever encountered. It's at least 50% less cryptic than printf and stdio, and don't even get me started on iostream. Plus it's very powerful. I would say that DGDK is a great way to get started with C++, and these forums are a great place to ask for help. The only downside to starting with DGDK is there isn't a whole lot of tutorials/documentation (yet), leaving the forums as the only option for learning to program with it.
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 11th Dec 2007 20:26
Quote: "C++ isn't necessarily object oriented. I hate it when people use C++ features excessively, instead of using them sparingly to make the code cleaner/easier to read/write. DGDK is mostly C-like, and I would encourage everyone to use c-like programming style with C++ OO used sparingly, unless of course you're doing a purely OO design. In which case you can use C++ OO style...

As far as ease of use APIs, I would say that DGDK is one of the easiest to use APIs that I've ever encountered. It's at least 50% less cryptic than printf and stdio, and don't even get me started on iostream. Plus it's very powerful. I would say that DGDK is a great way to get started with C++, and these forums are a great place to ask for help. The only downside to starting with DGDK is there isn't a whole lot of tutorials/documentation (yet), leaving the forums as the only option for learning to program with it."


I mean to say that most, if not all, of Cooldudes problems have been due to basic syntax and conceptual errors. I would still suggest that even the most seasoned DB users pick up some basic C++ tutorials before delving in to DGDK. C++ is not easy, and to make the most use of DGDK you have to know about all the data types and various uses of C++.


Tux is my guildmaster.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 12th Dec 2007 16:16
Yeah - I agree - I "knew" c++ and do alot of Delphi/FreePascal (OOP and c like in many ways) - and when I went from DarkBasic to GDK - after not REALLY using C++ much - I went to that same tutorial posted above with a fine tooth comb and bothered IanM a whole lot (Probably Benjamin also)

Now - I'm no master - but I am becoming more proficient with it - and I'm glad I STOPPED game coding long enough to really LEARN the basics anew - so when I picked up DarkGDK - everything started clicking -
and I was RUNNING! ...tripped and fell a few times - still do - but Running! whooooo...OUCH. Darn it all!

Login to post a reply

Server time is: 2024-11-19 20:50:37
Your offset time is: 2024-11-19 20:50:37