Developing Iphone game - adding images at random
<p>I am currently writing an iPhone game for my coursework - space ship flying through space, if asteroid is hit ship slows down, if star collected, ship speeds up - I currently have the ship travelling through space and one instance of a star and one instance of an asteroid each added using:</p>

<pre><code>asteroid = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Asteroid.png"]];
[self addSubview:asteroid];
</code></pre>

<p>and </p>

<pre><code>star = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"StarImage.png"]];
[self addSubview:star];
</code></pre>

<p>I would like to add multiple instances of these objects to the game in a random fashion, However I am unsure of the best way to do do this. Does anybody have any suggestions??</p>

<p>Cheers x</p>
