Archive

Archive for May, 2009

Cocos2d Example – Accelerometer

May 25th, 2009 admin 9 comments

In this tutorial, we will utilize Accelerometer in the Bouncing Ball example. The ball will move when you rotate or tilt your iPhone. To complete this tutorial, you need to get the certificate to put your app on a device. It is because when your application asks for updates from Accelerometer, the simulator will not response.

Read more…

Categories: iPhone Development

Cocos2d Example – Collision

May 20th, 2009 Kyle 5 comments

In my last article Cocos2d Example – Bouncing Ball, a little ball bounces up and down on the floor. Continue with that article, some effects will be made when the ball hits the floor. In order to achieve this, we first need to detect collisions between the ball and floor. Fotunately, ChipMunk can do this for us. What we need to do here is just using function cpSpaceAddCollisionPairFunc to register our callback function which can response the collision event.

Read more…

Categories: iPhone Development

Cocos2d Example – Bouncing Ball

May 10th, 2009 admin 18 comments

In this example, we will use Cocos2d and ChipMunk physics engine to implement a bouncing ball. A ball falls towards the ground because of the force of gravity. The basic idea of ChipMunk is that you define some physical objects (including bodies and shapes, but they are invisible) in the space, then ChipMunk will simulate what happens to these objects. You should setup a callback function to update these objects’ visual representation (e.g., a sprite created with image).

Read more…

Categories: iPhone Development

Cocos2d Example – Move Sprite

May 10th, 2009 admin 5 comments

Cocos2d engine significantly simplifies the process of iPhone game development. In this example, we will use an image of red square as the sprite. When we touch a position on the screen, the sprite will smoothly move to this position. Before starting this tutorial, we should first make sure the Cocos2d envirenment has been built up. In order to simplify this process, you can download Cocos2d 0.7.2 project template from here and install it at a proper location.

Read more…

Categories: iPhone Development

Hello world!

May 10th, 2009 admin 1 comment

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

Categories: Uncategorized