Paralaxer

[UPDATE Aug 27, 2014] Paralaxer has been greatly enhanced and is now known as the Ultimate Cocos2d-x Platformer Engine. This page is left purely for historical reference.

I am starting to learn Cocos2dx and this is definitely the best guide I have found. Thank you so much for writing it!
Lorenzo N.
A very good way to learn cocos2d-x!!!!
Chuck B.

With Paralaxer's source code, you'll learn how to make a game that handles multiple platforms and resolutions with ease.

Paralaxer looks crisp no matter what screen you play it on. That's because it uses three tiers of art assets.

If you're running an old iPhone or Android device, it uses SD images. If you've got an iPhone with Retina or a Kindle Fire, it uses the HD images. Got a retina iPad or MacBook Pro? Paralaxer cracks out the double-mega-huge images.

 
 
 
 
 

A look at Paralaxer's source code.

Paralaxer uses Box2D for physics, TMX tiled maps for levels, the Tiled map editor for level editing and the KITProfile class for automatic resource loading (available only in the Paralaxer code base). An AI subclass is provided to show you the basics of how to implement different and unique enemies and NPCs.

Paralaxer's source code is clean, well-commented and Doxygen-ready. Here's a look at Player.h and Player.cpp.

Contents of the Download

  • Complete game source code to Paralaxer -- including all .cpp and .h files.
  • Project files for Xcode, Visual Studio, Eclipse & commandline make.
  • Customized Android make scripts, so you can Build & Run for iOS (or Mac) in Xcode while doing a make && make run for Android in a shell or terminal.
  • Media assets for the game Paralaxer, including spritesheets, backgrond art, sound effects and music
  • A bonus royalty-free art package with thousands of 2d sprites, backgrounds & textures
  • A recent, stable, customized release of Cocos2D-X (currently based on version 3.x).
 

What's so great about Cocos2d-x?

  • It's free! Save your hard-earned cash. Cocos2D-X is 100% free and you never have to pay any royalties.
  • It's open-source. Need to change one little thing in the game engine? Go ahead.
  • It's wicked fast. With Cocos2D-X, it's easy to get 60 FPS, even on older devices or full-screen on Mac or Windows.
  • Develop on Mac, Windows or Linux! Write code in your most comfortable IDE, whether that's Xcode, Visual Studio, Eclipse or Emacs.
  • Deploy to Android, iOS (requires a Mac), Windows, Mac, Linux, Windows Phone and many more platfoms, all with the same code base.
  • Well-known API. It uses the same API as Cocos2D-iPhone. So if you're familiar with CCDirector, you'll be right at home with the Cocos2D-X.
  • Lua & Javascript support. Cocos2D-X has built-in support for the Lua and Javascript languages. When it comes to writing your game's logic, you've got plenty of options. Not only that, but if you write your entire game in Javscript, you can easily port it to the web using Cocos2d-HTML5.
  • The Cocos2D / Cocos2D-X / Cocos2D-JS paradigm is mature. Once you get the hang of it, you'll be able to code at ludicrous speed.
  • Thousands of published games and growing every day.
  • It's MIT Licensed. The MIT license is one of the most flexible and open-source-friendly licenses out there.
  • Handles OpenGL for you. If your allergic to GLuints, fret not! You'll never have to learn OpenGL. Unless you want to, of course. In that case, you can override any node's draw function and glBlendFunc away. Cocos2d-X uses OpenGLES 2.x on mobile devices and OpenGL 2.x for desktops, so you've got the power of shaders at your disposal.
  • The Action API is really handy. Everything in Cocos2D-X is a node and every node can run multiple actions. Want to scale a sprite, rotate it, fade it out and then invoke a callback function? It takes only a few lines of code.
  • Supported by a thriving community. This is one of those golden nuggets that makes coding with Cocos2D-X such a pleasure. The community is there to help you.
  • Has physics, sound & a tilemap parser. Comes with Box2D and Chipmunk for physics, CocosDenshion's SimpleAudioEngine for cross-platform sound, and even a TMX tile map parser so you can make levels with the open-source Tiled editor.

How is Paralaxer more than just Cocos2d-X?

Cocos2d-X is a free game engine. So what do you get when you buy the Paralaxer source code package that is above and beyond vanilla Cocos2d-X?

  • Paralaxer is a complete, working example game.
  • Paralaxer has clean, well-written documentation in the code and an entire PDF book about how to make your own game based on Cocos2d-X.
  • Paralaxer has well-tested, platform-specific projects. You get a clear example of how to setup a combined iOS & Mac Xcode project, an Android make project, a Windows Visual C++ project and an Eclipse project -- all in one neat folder and based on the same game source code.
  • The version of Cocos2d-X we include is always a recent, stable release (currently 3.x) with any minor modifications or bug fixes necessary to get it compiling cleanly or running correctly on Windows, Mac, iOS and Android.
  • You get lifetime updates, so whenever we release enhancements to the platform projects, the source code, the artwork, the PDF book and/or Cocos2d-X itself, you get to download for free.
 

Why code with C++?

  • Most portable language. This is a big reason to go with C++. It's simply the most portable language around. Whether you are compiling for Mac, Windows, Linux, iOS or Android, they all support C++ natively. Objective C is such a beautiful language and so is C#, but the fact is that these languages aren't supported natively on all platforms.
  • Fastest language. Google recently did a study and found that C++ is the best-performing language around. When you want to write games, you need that speed.
  • Most common-place language in game-development. If you've been a game programmer for awhile, you already know all about C++. In the game dev world, C++ is ubiquitous, omnipresent and -- if you believe in quantum entanglement -- perhaps even omniscient.
  • It's a stick-shift. C++ is a car with a manual transmission. Sure, it's not as easy to drive as an automatic, but it gives you a whole new level of control. If you're one of those people that prefers to clutch into neutral when hitting a patch of gravel, C++ is going to be a love affair.
  • Recently improved C++11. C++ just got a make over called C++11. There's a few bits of syntactic sugar that will make your programming life easier. The auto keyword, for example, is simply awesome. The great news is that we've written Paralaxer in C++11 and found out all the things that you can and cannot do with a cross-platform game code base. In addition, Cocos2d-X has recently been refactored into entirely C++11 code as of version 3.0.

System Requirements

To develop for iOS and Mac, you'll need a Mac computer capable of running Xcode 4.3 or newer. Grab Xcode from the Mac App Store, sign up for a developer account and you'll be ready to deploy.

To develop for Android you'll need to get the latest Android SDK and NDK. You can install those on just about any operating system.

To develop for Windows you'll need a PC computer cable of running Microsoft Visual C++ 2012 or newer. If you don't have Visual C++, you can still develop on Windows for Android with the Android SDK & NDK.

Flexible License

In plain English, the source code for the example game can be used royalty-free in as many projects as you'd like.