PDA

View Full Version : Random Bounceing Balls




Seza
Nov 9, 2009, 01:45 PM
Hey

I started with an app where I need to use a random function of the random number of balls bouncing around at the screen. So each lvl are there a random number of balls are bounceing around hope there are some who wants to help me. Thanks in advanced Seza


The code: .m http://pastebin.com/f487d7a8d .h http://pastebin.com/fbb2d114



dukeofism
Nov 9, 2009, 03:23 PM
Hey

I started with an app where I need to use a random function of the random number of balls bouncing around at the screen. So each lvl are there a random number of balls are bounceing around hope there are some who wants to help me. Thanks in advanced Seza

What aspect of the code do you need help with? No one can help you if you don't tell them what troubles you are encountering.

Seza
Nov 10, 2009, 08:22 AM
What aspect of the code do you need help with? No one can help you if you don't tell them what troubles you are encountering.


The code: .m http://pastebin.com/f487d7a8d .h http://pastebin.com/fbb2d114

Thanks :)

robbieduncan
Nov 10, 2009, 08:36 AM
The code: .m http://pastebin.com/f487d7a8d .h http://pastebin.com/fbb2d114

Thanks :)

What, exactly in detail, is not working as you expect?

Seza
Nov 10, 2009, 09:30 AM
I want to add a random function, so each lvl has a random number of ball baounceing around at the screen. I Dont know how i should code this random function ? :(

robbieduncan
Nov 10, 2009, 10:17 AM
This is the very first search result (http://developer.apple.com/iphone/library/documentation/System/Conceptual/ManPages_iPhoneOS/man3/random.3.html) for random on the iPhone Developer Center. Was that really so hard?

Kingbombs
Nov 10, 2009, 10:39 AM
you use arc4random() at the top where you #define
are you using someone else's code and not understanding it?

Seza
Nov 10, 2009, 12:16 PM
I Want some help with an function so every time at each lvl there should be a random number of balls bounceing around. I dosent know how to make that random function code, i want some help to write that code. Thanks In advanced :P

dejo
Nov 10, 2009, 12:24 PM
long numberOfBalls = random();
There. How's that? ;)

Seza
Nov 10, 2009, 01:59 PM
Thanks but where should i write it ? :) Where in the code ? :)

dejo
Nov 10, 2009, 02:12 PM
Thanks but where should i write it ? :) Where in the code ? :)
In the code that is the start of each level.