Racing game

...

guden,

also ich hab auch mal nen kleinen panzer spiel gecoded mit turm drehen und schießen und so spielereien, aber der code war nicht so ausgereift, darum nun hier der code von Madokan aus dem flashforum.de:



by Madokan [25-08-2001 00:29]

movieclip.prototype.drehung = function () {
_y -= (Math.cos(Math.PI/180 * _rotation))*w;
_x += (Math.sin(Math.PI/180 * _rotation))*w;
}
movieclip.prototype.carcontrol = function (faktorN,faktorP,fG,rG) {
if (Key.isDown(Key.LEFT) && Key.isDown(Key.UP)) {
_rotation -= faktorN;
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.UP)) {
_rotation += faktorP;
}
if (Key.isDown(Key.LEFT) && w > .1 && (!Key.isDown(Key.UP)) && (!Key.isDown(Key.DOWN))) {
_rotation -= faktorN;
}
if (Key.isDown(Key.RIGHT) && w > .1 && (!Key.isDown(Key.UP)) && (!Key.isDown(Key.DOWN))) {
_rotation += faktorP;
}
if (Key.isDown(Key.LEFT) && Key.isDown(Key.DOWN)) {
_rotation += faktorP;
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.DOWN)) {
_rotation -= faktorN;
}
if (Key.isDown(Key.UP)) {
drehung();
}
if (Key.isDown(Key.DOWN)) {
drehung();
}
if (Key.isDown(Key.UP)&& !(Key.isDown(Key.DOWN)) && w > -rG && w < fG) {
w += .05;
}
if (Key.isDown(Key.DOWN) && !(Key.isDown(Key.UP)) && w > -rG && w < fG) {
w -= .05;
}
if ((w > .1) && (!Key.isDown(Key.UP) )&& (!Key.isDown(Key.DOWN) )) {
drehung();
w -= .03;
}
if ((w < -0.1) && (!Key.isDown(Key.UP) )&& (!Key.isDown(Key.DOWN) )) {
drehung();
w += .03;
}
if ((w < .1) && (!Key.isDown(Key.UP) ) && (!Key.isDown(Key.DOWN)) && w >= 0 ) {
w = 0;
}
if ((w > -.1) && (!Key.isDown(Key.UP) ) && (!Key.isDown(Key.DOWN)) && w <= 0 || Key.isDown(Key.UP) && (Key.isDown(Key.DOWN))) {
w = 0;
}

}




hier sein passendes swf:

http://www.flashangel.de/fla/fsauto.swf


hier seine fla:

http://www.flashstar.de/tutlist/redirect.php3?id=162&link=../zip/fsauto.zip


in diesem sinne, thx @him.



so, keep on walking :)
 
yo, thanks ohio,

Hatte den Threat irgendwie vergessen. sorry !

Aber das beispiel kommt der Lösung schon ziemlich nahe.

nochmal thanks.
 
Zurück