How can I customise my shooting game with several different 'movieclips' that act as the bullets - AS 3.0
So I have a very simple shooting game. Right now I have gotten it to shoot with no problem. But what I want to do is randomise the bullet so that it will shoot out different colour bullets that I have created also as movieclips.
The code I have for shooting the same bullet is:
var bulletTimer:Timer = new Timer(200);
bulletTimer.addEventListener(TimerEvent.TIMER, timerListener);
function timerListener(e:TimerEvent):void
{
//In the Library linkage for a movieclip should be Bullet
var tempbullet:MovieClip = new bullet();
//Place the bullet at the tip of the player's gun
tempBullet.x = player.x +(player.width/2);
tempBullet.y = player.y;
tempBullet.cacheAsBitmap = true;
tempBullet.speed = 10;
Bullet.push(tempBullet);
bulletSound.play(); //Play sound
addChild(tempBullet);
}