Razor Code
Rambling about code since quite recently

Topics

User Functions





    Don't have an account yet? Sign up as a New User
    Lost your password?

Events

There are no upcoming events

Older Stories

Sunday 14-Sep

  • ACM ICPC 2008 (0)

  • Monday 11-Aug

  • NZ Programming Comp (0)

  • Sunday 27-Jul

  • Blast from the past (0)

  • Monday 21-Jul

  • Timetable generator again (0)

  • Tuesday 08-Jul

  • Hosting (2)

  • Saturday 05-Apr

  • Sparse Volume (0)

  • Friday 28-Mar

  • Carmack (0)

  • Tuesday 04-Mar

  • Back to Uni (0)
  • Dell Kill Switch Direct (0)

  • Monday 18-Feb

  • Lappy (0)

  •  Platformer01  

    Platformer01

    < Previous    Next >

    Introduction

    This series of video tutorials demonstrates how to create a simple 2d platform game using C++ through Codeblocks, OpenGL, various pieces of my game engine called Rendjin, and anything else we might happen to need along the way. Before each video, there will be a page such as this one that will cover anything you need to know about the tutorial, any high level concepts you need to understand, and any mistakes I made. Notice I only said I'd cover high level concepts. What the actual function calls do and what their parameters mean is not worth remembering, you can look that up in a reference. Knowledge is ok, but understanding is much more useful in the long run. In this particular tutorial, I will show you how to set up Codeblocks for a moderately sized project and open a window using classes from my engine. The reason I show how to set up Codeblocks, is that there never seems to be much information for beginners on how to use their IDE. Most tutorials try not to be specific to a particular IDE, and it often leaves people a little lost.

    Disclaimer

    I am not a professional. I'm just a kid who's spent far too much time programming games. I don't know everything, I will make mistakes, and my voice is really annoying.

    The videos, source code an information are provided without any warranty. I will not be held responsible for any damages. The code is released under the MIT license (provided in the source, very unrestrictive), and you may not redistribute the videos, though that could change.

    Motivation

    I've been a bit disappointed with the tutorials I've seen floating around the internet. The style of the code of many of them leaves something to be desired, and often they are little more than a code snippet with extra comments. They provide one way of doing things, and enough text to convince the reader that they know how it works. So, said reader simply copies the code into their latest project, and is happy. Till they decide they want to change it, and realise they don't understand why it works, or as they case often is, used to work. I don't mean to criticise any specific writers with this, some tutorials are indeed very good. But I hope to do things a little differently. I'll provide text, but it won't explain what specific functions do, as I mentioned earlier. I'll provide a bit of code which can be copy&pasted freely, such as the windowing code for this tutorial. You don't need to understand it at this stage, you just use it as a library, like OpenGL. But the application specific code, the code which I'll be writing in the video tutorials, you are supposed to understand. I'll demonstrate what can be done, but I won't be giving you any code. It's up to you to sit down and write it, then expermient with it. Sure, you could painstakingly copy it from the video, but I recommend closing the video and just using what you remember. Heck, you could use it to make an RPG game if you want. My goal is just to get you started, and demonstrate reasonably good design so you won't brick yourself into a corner once you're out doing your own thing. I have no idea at this stage if this is a good plan, but I'm giving it a shot. Your feedback is appreciated!

    Tools

    Make sure you download and install Codeblocks.

    Code::Blocks IDE

    I'm using the old stable release, 1.0-RC2 for this tutorial, simply because it doesn't change every night.

    Download and extract Rendjins windowing classes

    Rendjin windowing classes

    C++ is not the best language for making a platform game. In fact, it's a pretty bad language in a lot of ways. So why did I choose it? Simply because it's what I know. It's what most people seem to know. If you have plans to become a game programmer, then chances are you'll need it at some point, so might as well get used to it. Throughout this series, I'll assume that you know enough C++ to get by. In saying that, if you're proficient with a similar language you'll likely be able to follow what's going on. I'm not planing on using many constructs that would make your head spin. While fun, I doubt member function pointers to templated classes would be that useful. I should also mention that the compiler we are using is MinGW. Codeblocks does not compile anything, and people might look at you funny if you act like it does. OpenGL may be a little overkill, but it works fine as a 2d acceleration API, and it's good to know if you plan to move to 3d.

    Errata

    The words "target" and "profile" are used interchangeably throughout the tutorial. Target is the correct term, in Codeblocks at least.

    See any mistakes? Let me know.

    < Previous    Next >

    Last Updated Sunday, December 17 2006 @ 07:29 PM NZDT|344 Hits View Printable Version


    Who's Online

    Guest Users: 4

    IM Widget

    Get Firefox

    Get Firefox!