Hello.
I am making a simple space game where you fly along and can strafe side to side. I have made my spaceship so that it can shoot bullets
What i would like to know is what do i need to do so that when a bullet hits an enemy ship that ship explodes?
//This is how i made my bullets
First of all i made a movie clip called ‘bullet’ which has an instance name of bullet.
I applied this script to the bullet
onClipEvent(load)
{
speedX = 25
}
onClipEvent(enterframe)
{
for (var i = 0; i < speedX; i++)
{
_x++;
}
}
And then i applied this spcript to the spaceship that shoots the bullets
//Bullet Shooting
onClipEvent (load)
{
i = 0
timer = 0
dir = "right"
}
onClipEvent(enterframe)
{
if (!Key.isDown(Key.SPACE))
{
timer = 5
}
if (Key.isDown(Key.SPACE))
{
if (timer >=5)
{
i++
if (dir == "right")
{
duplicateMovieClip("_root.Bullet", "Bullet" + i, i);
_root["Bullet" + i]._x = this._x
_root["Bullet" + i]._y = this._y - 0
_root["Bullet" + i]._visible = true
}
timer = 0
}
timer++
}
}
//
Please help me