728x90 AdSpace

Latest Article

Cocos2D-x and Box2D Angry bird Like Game Source Code

Cocos2D-x and Box2D Angry bird Like Game  Source Code Circus Valley Uses of Box2D Physics Engine with Cocos2D tutorial Develop a Angry Birds Like Tutorial Develop An Angry Birds Like Game With Cocos2D -x And Box2D Game 

Circus Valley Game Code 

we have to create a sling shot thrower that will throw one projectile at a time on to the stage, the goal is to make Clown fall(remember angry birds). The projectile will move under the force of gravity and sling force and land among the stage objects. There will be a number of object types (explained later). We will detect projectile to object, projectile to screen boundary, object to screen boundary, object to object and everything to Clown collision.
 Game Mechanics:
o    We want to have different objects and implement different properties for each object. These will be friction, mass, breaking thresh hold values, restitution and any other properties that you would like to add.
o    Thresh hold value, for the scope of this game thresh hold value means a fixed value of force applied on an object in case of collision with another object. It depends on the current momentum (mass x velocity) of current object and the colliding object. They can be Ballon: 1x, Wood: 3x, Stone 10x, where x is some value that you choose for your ballon.
o    To make the game more interesting we want the objects to have different behaviors, for each object you have to define three force thresholds, a) move, b) partial destroy and c) destroy. If the force is within move threshold, the object will only move or topple, if the force applied is between move and partial destroy threshold, the object will have cracks appear on it, and finally if the force is larger than destroy threshold the object will we destroyed. Details given later.
o    clown, for simplicity you can use a rectangular bounding box around him, to make things interesting you can use a large restitution value for Clown so that it will be difficult to topple him over.
 Source Code Download 

Features (have to implement):
·  Projectile will move when mouse is clicked, dragged and released. Its velocity and movement angle will depend on the position difference from its initial position; you have to implement a restriction on distance it can be displaced with mouse drag.
·  Projectile will collide with objects; if the collision velocity is within thresh hold of the specific object it will move, for objects resting over another object it will topple over. If the velocity is over the thresh hold value the object will be destroyed.
·  Objects of different nature will have different properties eg the balloon can have negative mass, allow it to go against gravity.
Scoring should be done on number of objects moved + number of objects destroyed

 Source Code Download 

References :

  • How To Make a Catapult Shooting Game with Cocos2D-X and Box2D :http://www.cocos2d-x.org/boards/6/topics/4391 
  • Ray`s blog :http://www.raywenderlich.com/4756/how-to-make-a-catapult-shooting-game-with-cocos2d-and-box2d-part-1
Cocos2D-x and Box2D Angry bird Like Game Source Code
  • Title : Cocos2D-x and Box2D Angry bird Like Game Source Code
  • Posted by :
  • Date : 23:50
  • Labels :

  • Blogger Comments
  • Facebook Comments


  1. Cannot get your game to work in IOS. What version of Cocos2d-x you are using?