Hi. We wrote a little game with Cocos2D-X,
And released the source code!
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.
With Paralaxer's source code, you'll learn how to make a game that handles multiple platforms and resolutions with ease.
So what are you waiting for?
The free Cocos2D-X book.
This website is home to an online book about how to make Paralaxer from scratch. It's called "How to Make a Platformer Game With Cocos2D-X".
This is a living book. It gets updated as Cocos2d-X does. It covers everything from creating a meta-project to artificial intelligence. There's even a chapter about how to publish games yourself and become a wealthy apprepreneur.
The downloadable Paralaxer starter kit includes a PDF version of the online book. It's exactly the same content as you see online, except it's all packaged into one neat book you can flip through at your leisure.
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.
- The Cocos2D / Cocos2D-X / Cocos2D-HTML5 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.
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
autokeyword, 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.
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.
Ready to download all the code? Excellent.
Brought to you by the iPhone Game Kit.
Copyright © 2014 Wizard Fu Inc. Some Rights Reserved
iPhone, iPad, iPod touch, Xcode, Mac, and Mac OS are registered trademarks of Apple Inc. Wizard Fu Inc. is an independent corporation and has not been authorized, sponsored, or otherwise approved by Apple Inc. Android is a trademark of Google Inc. Cocos2D is a registered trademark of Ricardo Quesada. Windows, Windows Phone, Visual Studio, the Windows logo, and the Visual Studio logo are registered trademarks of Microsoft Co. Bada and the Bada logo are trademarks of Samsung Electronics Co., Ltd. Marmalade is a trademark of Ideaworks3D Limited.