• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
shaqb4

Need to change code copied from a tutorial

7 posts in this topic

A few weeks ago, I finished  a pong clone with SDL and planned on putting it up on github. Some of my code is taken directly from the Lazyfoo tutorials found at http://lazyfoo.net/SDL_tutorials/index.php.

 

Specifically, I used the Timer class taught on the following page, as well as the apply_surface functions found in the first few starting tutorials.

http://lazyfoo.net/SDL_tutorials/lesson13/index.php

 

In his FAQ he states 

 

Q: Can I use your code to make a game?

"Q: Can I use your code to make a game?
 
A: Basically my rules are:
1) If you're using it for a closed source program, go nuts.
2) If you're using it for an open source program, please cite the chunks of code you used with something like:
 
/*This piece of code was originally from Lazy Foo' Productions
 
3) I you're using it for a GPL, LGPL or other such program which gives public rights to the code, I'm going to have to say no.
4) If you're using it for a tutorial, you're going to have to use your own original code."
 
 
You still need contact me and show me specifically the code you plan to use and what you're going to do with it so I can approve."
 
 
 
 
I contacted him, but after a few weeks there hasn't been a reply. So my question is what should I do now? As far as I can tell, my options are to either wait for a response or change the code. I can't think what I could change in the Timer class, though. It's pretty straight forward, with start, stop, pause etc. I assume just changing the variable names wouldn't count as making it my own?
 
Any recommendations for how I could make the code my own would be appreciated. (such as other ways to implement a Timer). 
Edited by shaqb4
0

Share this post


Link to post
Share on other sites

Others may disagree but I'd just go ahead and credit the code at the top of the file, providing a link to the tutorial. You've made an effort to contact him and waited a more than reasonable amount of time for a response.

 

It's such basic code that any rearrangement is likely going to be largely superficial.

0

Share this post


Link to post
Share on other sites

Or just scrub it and rewrite it. The purpose of a tutorial isn't to give you a source of usable code. That's what libraries are for. Make sure you understand the subject matter, then get rid of what you have and write it over from scratch. Then you won't have to deal with it.

0

Share this post


Link to post
Share on other sites

It's such basic code that any rearrangement is likely going to be largely superficial.

 

While this may be true, you're forgetting something that's very important. When you take code you found online and use it for your project, you should always reformat it to fit in with the rest of your code. Everything from naming conventions, use of white space, layout, and even the way the functionality of how the code works, all of it should be in line with the rest of your code. Cohesiveness is a virtue.

 

If you just copy-paste code from a bunch of different sources, you end up with what's known as Frankenstein code, in which case it'll be an incomprehensible, disorganized mess in which nothing is consistent.

Edited by Ludus
0

Share this post


Link to post
Share on other sites

My point was that a slight bit of reformatting won't really get around the fact that it's copy/pasted tutorial code.

 

Ultimately, it's a Pong clone to help him understand the basics of game programming and there's nothing wrong with following along with and using code from a tutorial if that's what you're comfortable with. It's just my opinion that having him go back for the sake of it isn't a productive use of his time.

0

Share this post


Link to post
Share on other sites

Or he can just follow the instructions:

 

"If you're using it for a closed source program, go nuts."

 

Since it's a throw-away program he can just keep it closed source and not put it on GitHub and move on to his next game.

0

Share this post


Link to post
Share on other sites

Thanks for the replies, everybody. :)

Since it's a throw-away program he can just keep it closed source and not put it on GitHub and move on to his next game.

 

I'd like to put it on github because one.) I figure being able to use github would be a useful skill and 2.) It would make it easier to get feedback on my code.

 

Also, my next game will probably need a timer also, so I might as well change the code now. The problem I'm having is that I don't know what I could change. I could get rid of some  member functions, change names, etc. I looked up other implementations for a Timer class, but they were mostly just slight variations of the one I have now. Any suggestions? (I'm not trying to ask you to change the code for me, I just want ideas for what I could change).

0

Share this post


Link to post
Share on other sites

What I would do is post it on your GitHub and send the guy the link to it and let him decide. As long as you're not making money off of it I wouldn't think he'd have a problem with it.

0

Share this post


Link to post
Share on other sites

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  
Followers 0