Copy link to clipboard
Copied
Hello,
I am having a problem developing a game in actionscript 3.0. The plan for the game is to have planes fly across the screen and the player needs to shoot it by clicking on it. As the player gets more points, there needs to be more planes flying across the screen. No matter what I try I cannot get it to work. Can anybody offer any coding suggestoins for the coding in general, and duplicating the object and spawning it off to the side of the stage.
Create the plane as a library object and assign it a class name (say you name it Plane). To create a new instance of it you just use...
var another_plane:PLane = new Plane();
addChild(another_plane);
planes.push(another_plane);
The last line places the newly created plane in an array that you would define ahead of creating any so that you have some way of targeting the different planes that get added to process (move, etc) them. When one of them is no longer in play you can remove it from the arra
...Copy link to clipboard
Copied
Create the plane as a library object and assign it a class name (say you name it Plane). To create a new instance of it you just use...
var another_plane:PLane = new Plane();
addChild(another_plane);
planes.push(another_plane);
The last line places the newly created plane in an array that you would define ahead of creating any so that you have some way of targeting the different planes that get added to process (move, etc) them. When one of them is no longer in play you can remove it from the array so that it no longer gets processed.