FredericCox
%Europe/Berlin %010 %2005, 01:15
Hallo, momenteel moet ik Zo'n 1000 mc's gaan tekenen. Ik moet namelijk verschillende spelers(mcs) + een bal op verschillende coordinaten plaatsen zodat er eigenlijk voetbal gespeeld wordt. Nu kan je dat met tweens tekenen maar kan ik dit niet beter in actionscript doen?
Dit is de code die ik ongeveer in gedachten had maar ie klopt niet echt, iemand tips?
HomePlayer1.count = 0;
HomePlayer1_trajectX = new Array(200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30);
HomePlayer1_trajectY = new Array(450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10);
HomePlayer1.desx = HomePlayer1_trajectX[0];
HomePlayer1.desy = HomePlayer1_trajectY[0];
HomePlayer1.onEnterFrame = Move
function Move() {
this._x += (this._x+this.desx)/50;
this._y += (this._y+this.desy)/50;
if(Math.round(this._x) >= Math.round(this.desx)&& Math.round(this._y) >= Math.round(this.desy)){
trace("stop")
this.count++
this.desx = this._parent.HomePlayer1_trajectX[this.count]
this.desy = this._parent.HomePlayer1_trajectY[this.count]
}
}
Dit is de code die ik ongeveer in gedachten had maar ie klopt niet echt, iemand tips?
HomePlayer1.count = 0;
HomePlayer1_trajectX = new Array(200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30,200, 5, 30, 30);
HomePlayer1_trajectY = new Array(450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10,450, 5, 5, 10);
HomePlayer1.desx = HomePlayer1_trajectX[0];
HomePlayer1.desy = HomePlayer1_trajectY[0];
HomePlayer1.onEnterFrame = Move
function Move() {
this._x += (this._x+this.desx)/50;
this._y += (this._y+this.desy)/50;
if(Math.round(this._x) >= Math.round(this.desx)&& Math.round(this._y) >= Math.round(this.desy)){
trace("stop")
this.count++
this.desx = this._parent.HomePlayer1_trajectX[this.count]
this.desy = this._parent.HomePlayer1_trajectY[this.count]
}
}