![]() So let’s clear out the template so we have a known-good starting point. You could have the 'DrawMe' function take in the 'ball' as a parameter, and instead of just having 1 ball, you could have an array of balls, and on each tick of the 'setInterval' call, you could update all of the different balls by looping through the array and calling 'DrawMe' for each ball. However, for the purposes of this tutorial, we’re going to create everything from scratch so we can gain a good understanding of how things work. If you compile and run this template, you’ll see a pretty cool example demonstrating many aspects of Box2D. Bouncing Balls Battle Game Description Our popular Bouncing Balls is addicting enough to make you stay in front of the computer, trying to rise to the top of the leaderboard. So anyway, let’s get started learning Box2D with Cocos2D and start bouncing away! Creating An Empty Projectīegin by creating a new project in XCode by selecting the cocos2d v2.x cocos2d iOS with Box2d Application template, and naming your project Box2D. This tutorial assumes that you’ve already gone through the tutorial on how to create a simple game with Cocos2D, or have equivalent knowledge. It also has some elements of the sample project that is included in the cocos2d Box2d Application template, but explains how things work step-by-step. Bouncing Balls II Game Description This is a sequel of the popular Bouncing Balls game. Bouncing balls, geometry and physics The core of the question is calculating the new speed vectors, after having stated two balls are bouncing together. This tutorial is based on an excellent example by Kyle from, but updated to the latest version of Cocos2D and with some more detailed explanations of how things work. ![]() When the game starts, multiple rows of color balls will slowly move downward from the top. This tutorial helps get you started with Box2D with Cocos2D by showing you how to create a simple app that shows a ball that you can bounce around the screen by rotating your iPhone with the accelerometer. Prepare to be seduced and get addicted to one of our most popular games In the arcade classic of Bouncing Balls, your goal is to form groups of 3 or more balls of the same color so that they can be destroyed. Update : Fully updated for Cocos2D 2.1-beta4 (original post by Ray Wenderlich, update by Brian Broom).
0 Comments
Leave a Reply. |