tags:

views:

103

answers:

3

Hello all,

I want to create an application where balls keep moving on iPhone screen and they when they collide they gets a rebounding action. Every minute I want to add 1 balll upto a limit.

Is there any easy way to do it or anyone have done this kind of application.

A: 

Kind of an open-ended question but here is a tutorial on creating "pong" which should get you started thinking about the physics behind the motion.

ennuikiller
+1  A: 

I coded something like this up as an exercise a few months back. I was using around 120 facets on each sphere and very standard completely elastic 'billiard ball' collision physics - implemented directly in OpenGL using Phong shading.

I don't pretend the application was optimised but there wasn't any utter howlers in it, and on a standard iPhone (3G, not the latest 3GS ones) I was able to handle about a dozen balls before the frame-rate slowed to unusable.

Cruachan
Can you give me some code help. I am little bit confused about how to get this done.
RKBang
Get yourself a graphics engine (2D or 3D) and start going through its tutorials.
Shaggy Frog
There's really three sections to it. Loading the objects (basically reading an external 3D format file or creating them yourself in code), rendering them using OpenGL, and handling the collision physics. Look for example code in all these areas = there#s plenty around
Cruachan
A: 

Split up your app into lots of smaller problems. Start by displaying one square, then make it a sphere, then try displaying many of them, and then adding some movement, and then the physics calculations. There are probably lots of tutorials on each of those smaller steps.

whooops