Sign in to follow this  

Source code help..

This topic is 3491 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, well im new to this and was just wondering if there is any source code around to help me. Im looking for source code for a game similar to Donkey Kong, like the platforms n the throwing of objects n jumping etc. I would just like to see some code for the game to help me understand it more. IF anyone has any links could you please let me know Thanks EDIT : Sorry, its for C++ and id say i was a beginner lol..

Share this post


Link to post
Share on other sites
ah yeah thanks for that link

but i was just going to look at certain bits of it..

just any websites that might have a donkey kong type code?

Share this post


Link to post
Share on other sites
Quote:
Original post by rip-off
Advice.


Yeah, maybe we shouldn't read other peoples source code, maybe we shouldn't read tutorials, maybe we shouldn't use the internet to gain knowledge, maybe we shouldn't be able to read books, maybe we should only allow a certain number of people to learn stuff, maybe...

Oh sorry getting a bit excited there! :D

Share this post


Link to post
Share on other sites
Quote:
Original post by marraboy
Quote:
Original post by rip-off
Advice.


Yeah, maybe we shouldn't read other peoples source code, maybe we shouldn't read tutorials, maybe we shouldn't use the internet to gain knowledge, maybe we shouldn't be able to read books, maybe we should only allow a certain number of people to learn stuff, maybe...

Oh sorry getting a bit excited there! :D


Do you have actual criticisms or are you just waving your hands around yelling "slippery slope!"?

Share this post


Link to post
Share on other sites
Quote:
Original post by marraboy
Quote:
Original post by rip-off
Advice.


Yeah, maybe we shouldn't read other peoples source code, maybe we shouldn't read tutorials, maybe we shouldn't use the internet to gain knowledge, maybe we shouldn't be able to read books, maybe we should only allow a certain number of people to learn stuff, maybe...

Oh sorry getting a bit excited there! :D


You missed the point. It is more a cost/benefit analysis of using source code as a learning material. The author's point is that looking at source code, especially source code not intended for an inexperienced audience, has little educational value.

Tutorials are also covered by the author, but he considers them more on a quality/quantity basis. There are a lot of bad tutorials, many of which are popular. He argues against tutorials because a beginner will not be able to tell the difference between good and bad tutorials.

While I agree with jpetrie on the above points, from a practical standpoint there aren't many other reliable options. If you aren't going to learn from a book (of course there are also many bad or outdated books - but it is easier to find reviews) you have to work with what is available.

Many people starting learning from tutorials, or source, and manage to teach themselves to the point where they can tell bad from good. Then they can go about unlearning all the bad habits they've picked up. Clearly this approach is inefficient. The point of the article is to help beginners understand the consequences of such a path.

We get many posts here from people who come straight from a tutorial, and have attempted to change the code and end up in a maze of errors. That they usually cannot progress from there alone is a testament to how little they understand about the subject matter, even after following the tutorial. I imagine that looking at source code would produce the same symptoms, or worse.

Share this post


Link to post
Share on other sites
Quote:


Do you have actual criticisms or are you just waving your hands around yelling "slippery slope!"?


Just waving my hands around yelling, although a yell is more like... YELL!!! :D

I agree with most points regarding source code, particularly copying and pasting (this is bad) but it all depends upon what you want to achieve - I also think that you can get good code, bad code, good books, bad books, good advice, bad advice... The article starts... 'I’m frequently irked by budding programmers deciding to waste their time writing bad tutorials about a subject immediately after gaining a basic understanding of it' - quite simple... stop reading tutorials and you won't get irked.

It's a little rich of the 'Scientific Ninja' saying don't read source code or tutorials but read my advice. ;)

YELL, YELL, YELL!

All I am saying is that before the WWW it was difficult for a lot of people to get the reference material (good and bad granted) offered today.

:)

JT



Share this post


Link to post
Share on other sites
Quote:

The article starts... 'I’m frequently irked by budding programmers deciding to waste their time writing bad tutorials about a subject immediately after gaining a basic understanding of it' - quite simple... stop reading tutorials and you won't get irked.

"I’m frequently irked by budding programmers deciding to waste their time writing bad tutorials..." Reading them isn't the irksome part, its the fact that other people chose to write them without properly understanding what they're doing. That entire paragraph is simply a reference back to a related article and a segue to the actual topic of the article.

Quote:

It's a little rich of the 'Scientific Ninja' saying don't read source code or tutorials but read my advice. ;)

"Don't do X," means "don't do X." It doesn't mean "don't do Y which bears only a passing and perhaps superficial resemblance to X."

Quote:

All I am saying is that before the WWW it was difficult for a lot of people to get the reference material (good and bad granted) offered today.

Which you're right about, but that's hardly the point being contested here; in fact it's entirely irrelevant because today is, in fact, today. It's not ten or fifteen years ago when good information was far harder to come by, so one's modern-day practices should not be using the assumptions of the past.

Quote:

Im looking for source code for a game similar to Donkey Kong, like the platforms n the throwing of objects n jumping etc.
I would just like to see some code for the game to help me understand it more.
IF anyone has any links could you please let me know

You're looking for the wrong thing -- you should trawl Google and the like for information about beginning game programming, or getting started writing platformer games, et cetera. You don't actually want to go looking for source code specifically, whether or not you agree with (or choose to take) the advice in my article. That will simply lead you to places like SourceForge and Google Code, repositories of open-source projects (including games). That code will almost assuredly be unhelpful for you. If you must seek out source code, at least seek out code that exists to attempt to help you learn -- this is usually the code that accompanies the demos and whatnot that show up with articles (or tutorials) on writing platform games or what have you.

There's some source code in the GDNet Resources section too, but it is horribly, horribly outdated.

Share this post


Link to post
Share on other sites
even if the user has little experience depending on the individual he might or might not learn something.

take me for example i dont need a teahcer to really teach me math i can look at the examples and fill in the blanks. I have high comprehension level. I dont need people to talk to me lake a baby to understand what is being said. But on the other hand im not perfect i; i not good with words and communication its just not me.

so yeah show me code i look at it and play around and see whats happening and not just the high level things i think more about low level things too.


but sry i have no clue right now about that but im not sure but search around code is out there i think i remember running into the first "Super Mario Bros" code

Share this post


Link to post
Share on other sites

I've given up on this discussion when I ran into The Washu about the topic, but you just had to see that one coming Josh [smile]

Code (and code-filled tutorials) just work for people. It may not be the perfect tool to learn and yes, it may introduce some bad concepts to people, but the good coders will come through. If people aren't willing to learn to understand the code they use/write, nothing, no perfect tutorial, nor even a personal mentor, will help.

Share this post


Link to post
Share on other sites
Quote:
Original post by owiley
even if the user has little experience depending on the individual he might or might not learn something.

...


While I don't necessarily agree with everything that the article stated, the question I have to ask is "What will you learn from it?"

As mentioned in the article, you're assuming the code is actually correct. But a Donkey Kong game is fairly simple, and often times, used by beginners who might not take the best route to accomplishing such a program.

And even if they did make it the most efficient Donkey Kong in the history of the world, you'll have to question why they did things the way they did, which certainly won't be documented. Besides, what may be the most efficient way of doing something today could be wrong tomarrow.

Then you have to ask yourself, even if they did write a fairly clean version, is it right for you? C++ can't create Donkey Kong. You need external libraries for the audio, graphics, input, etc.

As you mentioned, a quick search on google could find source code. But Donkey Kong is fairly simple enough that rather than trying to code the game, try writing out a design document first and a fairly decent understanding of C++ and the multimedia libraries you choose to use will probably be a better course of action.

Share this post


Link to post
Share on other sites
Quote:
Original post by owiley
code is out there i think i remember running into the first "Super Mario Bros" code


The original Super Mario Bros. code would likely be written in assembly and would be full of NES-specific hackery. It would be illegible to a beginner trying to learn, and a terrible educational tool.

Share this post


Link to post
Share on other sites
dont know if it was legal or what not it was on programming heaven's site

it was in c and thats all i know its one of the first things i found when learning to program. dont know much else cause i jumped int directx with the help of andy pike tuts then opengl with this sites nehe tut and now studing id tech 2 and 3 and anything in-between.


[edit]

yeah, after googling for the source found out there is a ton of them out there ranging from c to vb.

Share this post


Link to post
Share on other sites
Quote:
yeah, after googling for the source found out there is a ton of them out there ranging from c to vb.


I googled and couldn't find anything on donkey kong or anything NEAR it. I guess your not allowed to link me to any of the sites?

I think the source would help me a bit, i use tutorials too but I would just like to see some source code.

Thanks for letting me know though!

Share this post


Link to post
Share on other sites
The other day I wanted to learn russian. So I listened to some russian guys talking for several hours. To my surprise, I didn't comprehend (let alone learn) anything. I even picked up a book, but it was all gibberish to me. What did I do wrong?

Share this post


Link to post
Share on other sites
Quote:
The other day I wanted to learn russian. So I listened to some russian guys talking for several hours. To my surprise, I didn't comprehend (let alone learn) anything. I even picked up a book, but it was all gibberish to me. What did I do wrong?


The problem is you don't know any Russian so you might want to start with a basic book containing Russian phrases that are translated in to English. :D

Or try this link... - but mind that this is an online resource and may not be a good source of study. :)

And... I've you have never read any body else's source code I'll show my arse in the town hall!!! :D

Ta

JT

Share this post


Link to post
Share on other sites
ok first you probley didnt ask what he was saying next what he was say wasnt clear to you. I mean we all learn about it in english. Ok you read a book with a word in it that you dont understand but given the words around it you can kind define it based on the other words. Same in coding execpt differnet you dont have to know coding to learn coding. take the syntac and play arounf with it to find out what it is doing. children does this all the time. they be curious about their toys so the break them and try to put them together. i did it and the teacher told my mom that was normal and to let me adventure out some

Share this post


Link to post
Share on other sites
Toying with source code you don't understand is very problematic (especially in C++) if you don't understand the basics of the language, because your altered code might give you the desired result although its behavior is actually undefined. Things like

int main()
{
int i = 0;
int k = i++ + ++i;
fun(i++, i++);

Thing* thing = new Thing();
delete thing;
thing->memfun();
}


I've read my share of foreign source code written my intermediate programmers, and most of it was... just terrible! Memory leaks, undefined behavior and violation of the things like the rule of three, exception safety and lots of other stuff.

Share this post


Link to post
Share on other sites

This topic is 3491 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this