Today I’d like to show a quick example of some of the basic work that I’m doing at the moment and show off what I’ve learnt so far. Allow me to introduce you to Cocos2D (http://www.cocos2d-x.org/) . It’s essentially an easy way of getting started with event driven programs and games in C++. Up until this point, we’ve just been making basic programs in the windows console that wait for a user input before performing any action or executing the next bits of code, Cocos2D allows us to create actual games that don’t need to wait around for input for stuff to happen and also deals with a lot of the nitty gritty stuff such as graphics APIs and drivers. What this makes for is what I like to think of as a sort of intermediate level of programming for games, it’s not quite pure C++ since there’s a lot of stuff we don’t deal with but also it’s not on the sort of “drag and drop” level of easy that you get with unity. Best of all, when something works, you feel like some sort of advanced genius, so I like it.
One of the key things within Cocos, and any type of games programming, is the idea of the games loop. This is a basic concept of checking for a player input of some sort, then performing actions based on that, this needs to be done every frame so could be up to an unlimited number of times a second depending on the framerate that you’re trying to achieve. Cocos also deals with various concepts (scenes, nodes, menu and others) and has it all controlled by something called the Director, something that manages everything within your game.
So what have I got to show? right now it’s a very basic program. there is a space marine looking sprite that can run back and forth and jump. Thats about it but I can wait to continue with it, I’ve been experimenting a little with clickable objects (there’s also a menu to it that gets you to the ‘Game’ scene). Anyway, enjoy this picture of some early stuff.