Racing game from scratch, part two

IMG_0493Second day we made quite a lot of progress, we now have 6 different tracks, we had working collisions, but had to remove it.

One of the problems I was facing is that each loop was taking far too long. To detect if the car is on the track, we convert the background image to a data object, then check the colour at the position of the car. I was using a method I had written before, isWallPixel which takes the image and the coordinates and returns the color. The problem is, each time this is called it converts the image to a data object, so this was happening 80 times a second, and slowing it down. Once I figured this out, I move the convert image to data code to be called once, when the view starts. This fixed all my loop overrun problems, and the game is very smooth.

Today, I will add music, sounds effects, a pause screen and the winners screen. Once done I can publish the app to the app store. It feels great to get the app out there.

Next, I want to add more players, maybe up to 8, add pickups on the screen, put back in collision detection, and improve the tracks.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>