Question

I'm planning to build a basic rebound iOS game in Cocos2D. Will Box2D be best suited for the following scenario?

The layout will consist of a target at the top of the screen, with obsticles in the middle of the screen, blocking direct view of the target from the bottom. The user will shoot a ball from the bottom of the screen by rebounding it of the sides and around the obsticles, aspiring to hit the target. Similar to a breakout style of game.

As the game levels progress, the obsticles will be moving dynamically, left to right and back, up and down etc..

I understand that the collision detection can be achieved using Cocos2D alone. Can the rebounding and trajectory of the ball off obsticles and walls also be achieved without using a physics engine?

I will have no need for gravity in the game scenario. A reduction in the velocity/speed of the ball will be essential.

Please note, I am new to iOS dev, coming from a background in front-end web dev.

Advise and help much appreciated.

Thanks

Was it helpful?

Solution

You certainly can do all that without using an existing physics engine. Once you start doing collisions with moving objects and objects of different shapes, though, it starts to become advantageous to use an out of the box solution.

It's easy to setup box2d without gravity and it will give you all of the collision calculations and velocity stuff

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top