PDA

View Full Version : Help Making enimies for a shoot em up style game and moving them


pitto
04-29-2005, 12:08 AM
Here is the code i have already made for this part

// create enemies
function createEnemy() {
if (noenemya>0) {
current = "enemya"+noenemya;
attachMovie("enemya", current, 100+noenemya);
noenemya--;
}
}

This makes the enemy (in the librery set as enemya) get put in the top corner, the noenemya is set to one at the start, later i will make it so that the enemies are put in at random times, and there will be more enemies.

Now i want to move it to the x value of 600, and then i will create the move function. I cant seem to get the enemy to move to 600, can someone help?

Pitto

Crismo
04-29-2005, 12:24 AM
There are a couple of different ways to achieve this.


//1.

this[current]._x = 600;

//2.

myNew_mc = attachMovie("enemya", current, 100+noenemya);
myNew_mc._x = 600;

pitto
04-29-2005, 12:35 AM
thanks that really helped alot
Pitto

pitto
04-29-2005, 12:42 AM
thanks that really helped alot
Pitto