TastyTeo
07-13-2009, 06:02 PM
stop();
attachMovie("path", "path", _root.getNextHighestDepth());
waypoint_x = new Array(40, 140, 140, 220, 220, 80, 80, 340, 340, 420, 420);
waypoint_y = new Array(140, 140, 60, 60, 240, 240, 320, 320, 100, 100, -20);
delay = 25;
new_monster = 0;
monsters_placed = 0;
onEnterFrame = function () {
if (monsters_placed<25) {
new_monster++;
}
if (new_monster == delay) {
monsters_placed++;
new_monster = 0;
min = attachMovie("minion", "minion"+_root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:40, _y:-20});
min.point_to_reach = 0;
min.speed = 1;
min.onEnterFrame = function() {
dist_x = waypoint_x[this.point_to_reach]-this._x;
dist_y = waypoint_y[this.point_to_reach]-this._y;
if ((Math.abs(dist_x)+Math.abs(dist_y))<1) {
this.point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x+this.speed*Math.cos(angle);
this._y = this._y+this.speed*Math.sin(angle);
this._rotation = angle/Math.PI*180-90;
};
}
};
I Don't know what is this, i just copied from:
http://www.emanueleferonato.com/2007/10/06/make-a-flash-game-like-flash-element-tower-defense-part-1/
May it help you to find a solution for me....
So let's start describing my problem...
I Want to make a game "Coin Collector".
and i just want to spawn coins....
Before describing i recommend you to take a look at "THIS GAME"
How they make spikes spawn??? I Want to make COINS SPAWN!!!
and the way is with waypoints i think
And let's describe......
Document Size: 550 x 400
FPS: 60
I Have a MovieClip exported to actionscript as "coin" and the instance name "coin" too.
So i want this coin to spawn from the upper part of the screen, and go straight down to the bottom of the screen....
so my movie clip "player"
exported to actionscript as "player" and the instance name "player" too
can catch the coins falling down from the screen... with little words a simple hitTest. When he catch a coin, the var: coins i want to increase by 1.
Thanks
MSN: theofilaktos.spendas@windowslive.com
G-MAIL: theofilaktos.spendas@gmail.com
Yahoo Mail: theofilaktos.spendas@yahoo.com
I Recommend you to send email to my Gmail and Talk to me to the MSN
And if you want reply here...
attachMovie("path", "path", _root.getNextHighestDepth());
waypoint_x = new Array(40, 140, 140, 220, 220, 80, 80, 340, 340, 420, 420);
waypoint_y = new Array(140, 140, 60, 60, 240, 240, 320, 320, 100, 100, -20);
delay = 25;
new_monster = 0;
monsters_placed = 0;
onEnterFrame = function () {
if (monsters_placed<25) {
new_monster++;
}
if (new_monster == delay) {
monsters_placed++;
new_monster = 0;
min = attachMovie("minion", "minion"+_root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:40, _y:-20});
min.point_to_reach = 0;
min.speed = 1;
min.onEnterFrame = function() {
dist_x = waypoint_x[this.point_to_reach]-this._x;
dist_y = waypoint_y[this.point_to_reach]-this._y;
if ((Math.abs(dist_x)+Math.abs(dist_y))<1) {
this.point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this._x = this._x+this.speed*Math.cos(angle);
this._y = this._y+this.speed*Math.sin(angle);
this._rotation = angle/Math.PI*180-90;
};
}
};
I Don't know what is this, i just copied from:
http://www.emanueleferonato.com/2007/10/06/make-a-flash-game-like-flash-element-tower-defense-part-1/
May it help you to find a solution for me....
So let's start describing my problem...
I Want to make a game "Coin Collector".
and i just want to spawn coins....
Before describing i recommend you to take a look at "THIS GAME"
How they make spikes spawn??? I Want to make COINS SPAWN!!!
and the way is with waypoints i think
And let's describe......
Document Size: 550 x 400
FPS: 60
I Have a MovieClip exported to actionscript as "coin" and the instance name "coin" too.
So i want this coin to spawn from the upper part of the screen, and go straight down to the bottom of the screen....
so my movie clip "player"
exported to actionscript as "player" and the instance name "player" too
can catch the coins falling down from the screen... with little words a simple hitTest. When he catch a coin, the var: coins i want to increase by 1.
Thanks
MSN: theofilaktos.spendas@windowslive.com
G-MAIL: theofilaktos.spendas@gmail.com
Yahoo Mail: theofilaktos.spendas@yahoo.com
I Recommend you to send email to my Gmail and Talk to me to the MSN
And if you want reply here...