Iphone SDK, arc4random CGPointmake?
- by Harry
I have tried using integers to store the number like so:
playPin = 35 + arc4random() % 118;
playY = -50 - arc4random() %100;
if (CGRectIntersectsRect(pin.frame, refreshpin.frame)){
pin.center = CGPointMake(playPin, playY);
pinend.center = CGPointMake(pin.center.x, pin.center.y+58);
}
Then using them, when needed, but... its random the first time, then it just keeps repeating itself.
then i tried this:
if (CGRectIntersectsRect(pin.frame, refreshpin.frame)){
pin.center = CGPointMake(35 + arc4random() % 118, -50 - arc4random() %100);
pinend.center = CGPointMake(pin.center.x, pin.center.y+58);
}
And this also doesn't work, you cant even see the items i want to display!
Any ideas?
Thanks.
Harry.