Iphone Cocos2d Game Day 4 – Collecting Coins

On day 4 I decided to attempt creating a “coin type” object and collect them using collision. Since I am using box2d for the player I created the coin sprites with a body but my problem was gravity. Everytime a coin was drawn it would fall down and bounce. To solve this I attempted turning the gravity off for the coin body (which I found a tutorial for doing this) BUT I could not get it to work. So I just left the bouncing coins and moved on to collecting them.

Collecting them was fairly easy and I got it to work in no time so I added a coins count with a label in the top right corner of the screen. I setup a magic number of 10 coins collected wins you the game. Once you win it tells you then restarts.

This was a fun exercise but I quickly found that in order to create some of the features I want in my game, Box2d will be very time-consuming for a beginner like myself. I think I might go with creating the game completely out of Cocos2d, which I seem to have better luck understanding, meaning no more Box2d?

Here is my Day 4 Video:

About PaulsonApps
I am a sole developer working on the IPhone platform. I run a blog which is a mix between journal and how-to on creating Iphone games using Cocos2D and sometimes Box2D, but it is mostly just about my experiences during each game's progression. I have no formal background in programming and have only just begun but I treat it as a hobby which makes every effort a little more enjoyable. I find when things are done as a job they lose that 'fun-factor'. I hope that the games I create for the Iphone get played around the world, and I hope you get a chance to try out all of my games, including 'PlanetOne - The 2D Platformer' and the soon to be released 'PingBall'. Keep reading the Blog, whatching my youTube channel, and buying my games!

3 Responses to Iphone Cocos2d Game Day 4 – Collecting Coins

  1. cl says:

    can you show on how to collect coins, I’m having a bit of trouble with that now. thanks, and i love the site. helps me alot

  2. cl says:

    thanks alot for that.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 66 other followers