LearnCocosTV 4: I see Road Nuts

On January 30, 2012, in LearnCocosTV, by Steffen Itterheim

In this episode you can see the Cocos2D Webcam Viewer in action. I also show you how to update a sprite’s texture while your app is running just by saving an updated version of the image, and how cool that actually is!

The second half of the video is devoted to explaining my work schedule. I’d like to believe that I have a unique and interesting solution to planning but I’m sure in some way or another it’s already been implemented.

I’m certainly influenced by Agile Development as much as I am by books like Getting Things Done and The 4-Hour Workweek. My revelation was simply this: stop wasting time planning tasks! Instead, plan your time and how you spend it.

Episode #4 – I see Road Nuts

• iDevBlogADay: Cocos2D Webcam Viewer
o Mac OS X Webserver File Download
• Kobold2D v1.0.2 released
• Poll: Which scripting language for Cocos2D?
• My work schedule explained

Tagged with:  

Wouldn’t it be awesome if you could update your game’s assets while your app is running? It turns out you can, and it’s not even very complicated.

Whether you want to tweak a game setting or experiment with a variety of image styles on the fly, this will be one of the things you wish you had been using all along! Either for faster development or as a design feature for your game.

In this case, we’ll build a New York Traffic Webcam viewer with Cocos2D. You will learn how to download files to your app at runtime with the iOS SDK and cocos2d-iphone, and how to check if the file on the web server has actually been modified.

Along the way you’ll understand how to use the Mac OS X built-in web server to speed up your development by replacing game assets on the fly. By copying files to a specific directory on your Mac you can make immediate changes to your running app!

And you don’t need any experience with HTML, Apache, or any other web server or web services technology. In fact, I consider myself to be an web-illiterate because I’ve hardly done anything programming-related with web services and servers in the past.

As usual, the project is available from my LearnCocos2D github repository under the MIT License. The project’s name is Cocos2D-UpdateFilesFromWebServer. To improve readability of the article I removed error checking from the code in the article.

Continue reading »

LearnCocosTV 3: Two And A Half Nuts

On January 13, 2012, in LearnCocosTV, by Steffen Itterheim

After a holiday-season hiatus (Happy New Year btw!) LearnCocosTV is back. This episode is somewhat shorter because I had a lot of catching up to do and a lot of chores which aren’t exactly show-worthy. But I did manage to port most of the Kobold2D projects to Cocos2D 2.0 beta. Too bad they look just the same as before.

A bi-weekly Show & Tell about Cocos2D, Kobold2D and iOS/OSX development by Steffen Itterheim.

Episode #3 – Two And A Half Nuts

• Updating Kobold2D to use Cocos2D v2.0 (beta)
• iDevBlogADay: Tips for updating to Cocos2D v2.0
• iDevBlogADay Source Code available on github

Tagged with:  

This quick comparison sheet gives you all the info to decide whether to use Cocos2D 1.x or Cocos2D 2.x. Contrary to most programs, a higher version number doesn’t infer “better” or “more”. There are pros and cons for both versions.

At the time of this writing the decision really only boils down to whether you want to use shaders and whether you must be able to deploy your app to 1st & 2nd generation devices. See for yourself, it’s that simple:

Cocos2D v1.x

(+) compatible with all iOS devices
(+) compatible with all libraries
(-) no OpenGL ES 2.0 shader programs

Cocos2D v2.x

(+) OpenGL ES 2.0 shader programs
(-) incompatible with armv6 CPU devices:
iPhone, iPhone 3G, iPod Touch 1G & 2G
(-) incompatible with these libraries:
Cocos3D 0.x.x, Chipmunk SpaceManager 0.1.2

All other differences to this day are minor, and most new features and bugfixes have been migrated back and forth between versions. For beginners I strongly recommend using v1.x as there’s a lot more documentation available for this version. Those who have no interest in writing shader programs can also safely use the v1.x branch without missing out.

Continue reading »

Line-Drawing Game Starterkit Box
Beginning today until and including Dec 26th January 1st 2012 the Line-Drawing Game Starterkit is only $49,50 instead of $99,00 (50% off).

Just enter this coupon code when you make the purchase:

MERRYXMAS

Merry Xmas everyone – you deserve it! :)

PS: I’ll be practically offline until the first week in January, but I’ll make sure to have a short iDevBlogADay post ready for you on Dec 29th.

Tagged with:  

Kobold2D v1.0.1 now available!

On December 15, 2011, in Kobold2D, by Steffen Itterheim

Kobold2D v1.0.1 is now available from the Kobold2D Download page or via github! You’ll find the Release Notes in the usual place.

The most important new features are:

Almost all bugs reported so far have also been squashed. Mainly several fixes related to KKInput, a crash with CCMenuItem* and blocks and an issue that caused Retina mode not being properly enabled.

A few minor convenience methods have also been added, for example CCDirector now has a continuously updated frameCount property that returns the number of frames drawn since the app started, and KKInput now has the anyTouchLocation property if you just want the touch location of any (the) finger on the screen.

Detecting collisions on pixel-perfect boundaries is the holy grail of collision detection in 2D games. As such, it seems like the ideal, if not to say perfect, solution to collision detection in general. Yet, it’s also quite complicated and the straightforward solutions don’t perform very well until you start optimizing the code.

This first post focuses on creating a pixel mask by analyzing the raw image data, as proposed over 3 years ago by Ernesto Corvi. It’s the fastest solution if you want to test if a point collides with a pixel on an image, which also works for rotated and scaled sprites. However it does take some optimizing to speed up detecting collisions between a bounding box of a node and the pixel mask, or two pixel masks.

The alternative solution is to render the two colliding objects onto a CCRenderTexture, as developed by Dani and others on the Cocos2D forum. It is able to detect collisions of arbitrarily rotated and scaled sprites but can be expected to be noticeably slower than a pixel mask. I will discuss this solution in a future iDevBlogADay post.

The results will find their way into Kobold2D, to make the solutions readily available to all developers.

Continue reading »

Page 9 of 27« First...7891011...20...Last »