my gaming past, present and future
Thursday August 21st 2014

Interesting Sites

Insider

Archives

Developer’s Corner

icon_gauntlet_mayaThis is where I post about game development: programming, game design, level design, art, etc. If you have questions, please ask them.

This page is translated to Serbo-Croatian language by Anja Skrba from Webhostinggeeks.com

A very important tutorial on pixel art that is too important to lose to the chaos of the internet:

So You Want to Be a Pixel Artist?


Xcode For Beginners

Romero : January 18, 2012 1:45 pm : Developer's Corner, News, Programming

I believe anyone wanting to learn programming should start with the basics, and that means the C language. It also means no graphics so the focus is on the language itself and understanding just the language, and not an IDE or environment like Flash. You can do plenty of good learning just by using text mode.

Here is a step-by-step walkthrough of how to get Xcode set up for programming simple console apps like you would find in any basic C book.

STEP 1: Install Xcode 4

It’s in the Mac App Store. Search for Xcode then get it. I believe it’s free. Next, after it’s downloaded, you need to run the app called “Install Xcode” (if you’re running Lion, you can find it by clicking the silver rocket ship dock icon). That is what will really install it. When that’s done, you can move on to step 2.

STEP 2: Create a New Project

This is the first thing you will see. Make sure you choose “Create a new Xcode project”.


Next, choose “Mac OS X”, then “Application”.

Then choose “Command Line Tool”. Click Next.


Now choose the options for your project, and where to put it.

Click Next.


Make sure to UNCHECK the option to create a git repository. You’re just starting to learn to code – source control can come later.

STEP 3: Set Up The Project Window

Now the project will start up in a window that will look confusing since you’re not used to this kind of information. Don’t worry — you don’t need to know about this yet, and you can get rid of it so you can focus only on your code.

First, select your main.c source by clicking on the name in the left pane.

Next, let’s get rid of all the bothersome info. Click on the View buttons so they’re all off like this.

Now you should be looking only at pure code.

Click on the PLAY button at the top-left to run the simple main() code that was generated for you. It will open up an output window at the bottom of the edit area.

Now, make the output area fill the screen from left to right by clicking the View buttons like so:

There! Now you have pure code and pure output!

To clean up the output and make it only show you your code output and no compilation messages, change the pulldown menu from All Output to Target Output.

Finally, I don’t like coding with a solid white background blasting my retinas all day, so I always choose a dark scheme.

To do this, press Command-, (comma) to bring up Preferences. Choose Fonts & Color. On the left pane, choose the theme Midnight. Your screen would look just like this…

That’s all there is to setting up a new console-only C project in Xcode with a simple environment! This is the view that my girlfriend Brenda prefers because it’s easy to just focus on her code.

4 Comments »

Text Console Library

Romero : November 23, 2007 4:10 pm : Developer's Corner

text maze console libraryWhen you first start coding in C/C++ your first programs are done in the console. The problem with the console nowadays is that the conio.h library no longer lets you do all the fun things it used to, like set the text color, set cursor position, clear the screen, etc. You can only print text out in a stream just like the olden days of the 70′s and teletype printers. Lame.

This is the problem that all beginning game coders run into and it really takes some of the fun out of learning when you can’t even sit down and try to write Pac-Man in text mode.

So I poked around and found a little snippet of code, added my own functions and now I have a nice little text console library you can use. Just add the console.h and console.cpp files into your empty Win32 console project and you can actually make text games. Without this kind of library you can’t really make any kind of fun text game other than an adventure.

I threw together a short sample program to demonstrate what you can do. It’s a simple maze that has a random exit (‘X’) in it; touch it and you win. The source is named main.cpp. The game? ULTRA-X OF THE FORBIDDEN REALM!

To add even cooler stuff to your console games you should download FMOD and link it into your project. Instructions on how to do this are on FMOD.ORG and are easy to follow. Imagine that – a text game with background music and sound effects.

Grab the code here (Windows only)

6 Comments »

Beginning C++, Part 2

Romero : April 30, 2007 6:50 pm : Developer's Corner

beginning c++ bookAfter further investigation and actual use, I would like to now recommend Michael Dawson’s book “Beginning C++ Game Programming”. I went to the book store, rifled through a ton of C++ programming books and after getting through my filter I settled on this book for my son Michael to start with.

Even though the title of the book sounds like you’ll be getting into a bunch of fun game stuff the reality is that all the focus for the first 8 or so chapters is just on learning C. C++ comes in during the next couple chapters and builds upon what you learned about C but doesn’t go too far – it keeps it simple.

Along the way you use the language to construct a few simple games that are all text-based which I believe is a great way to just focus on learning the language and some basics about game construction. So don’t be expecting to be drawing graphics and making sounds and using the mouse on a graphical screen – you need another book to do that and it should be AFTER you get through this one.

I got Michael a book on coding game graphics that he’s diving into now since he finished this book. I’m proud to say that he can program in C++ now after finishing this book and it’s not an overly long one either. It’s also very easy to understand with good explanations for the concepts.

Some things I would have liked to have seen in the book were explanations of switch() before its use, using struct{} and explanations of complex data structures, and explanations and use of printf. The book relies heavily on cout and cin which I’m not too fond of because of the syntax but they’re easy to understand when it comes to printing string objects. When Michael was going through the book I taught him printf and had him convert all the couts in the book to printfs – it showed him more about what goes on inside those string objects and was less typing when he needed to print %d, %s, etc. arguments.

One important note: the gaming college Full Sail uses this book as their introductory programming course book. Michael went into Full Sail right after finishing this book so he got to do it all over again. Much easier the second time!

Try it.

3 Comments »

Beginning Game Programming

Romero : May 30, 2006 4:06 pm : Developer's Corner

Just got an email about game programming books, a very popular question I get:

Hey John, I’ve mailed you before but I doubt you remember; with that said, I love your games! Always have, always will. I’ve done a bit of game programming with some beginner’s languages like GML and many versions of BASIC, but I’d really like to learn C. I have one question: I’ve pretty much learned all there is to make console applications, which is all I can find tutorials for. Where can I get some info on basic graphics programming? Just drawing/manipulating bitmaps or pixels, something like that.

Thanks!

-Jake

beginning game programmingHere’s what I would recommend with just a quick search on Amazon: Beginning Game Programming by Michael Morrison.

Now, I haven’t had to read a game programming book in about 22 years but this one seems pretty solid with good reviews. Sure, some of the reviews might be by the guy’s mom and friends but how else can you tell if it’s good unless you try it yourself?

I’m sure some of the readers here can recommend other great books – that’s what this section is for!

1 Comment »

Code Newbie

Romero : February 13, 2006 3:54 pm : Developer's Corner

code newbie logoContinuing on from my previous post, if you’re a beginning programmer there’s a great site out there for you: Code Newbie. You absolutely do not have to know how to program already when you go to this site and you can get great explanations of common programming problems in the forums. Check it out!

Leave a response »
« Page 1, 2 »
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Reader Feedback

2 Responses to “Developer’s Corner”

  1. Greg Taillon says:

    John, do you follow any journalism/gaming/web accounts on tumblr.com at all? There’s a lot of great blogs on it; if you haven’t, you should check them out!

  2. Hugo Lacombe says:

    Thanks Romero! This will be really useful xD

Leave a Reply