...searching...
Hallo Leute,
folgendes Problem:
ein Objekt (Grafik als Movieclip deklariert) bewegt sich anhand eines Timerwertes auf der x-Achse von links nach rechts über die Bühne. Mittels Pfeil Rauf/Runter-Tasten kann die y-Position interaktiv geändert werden.
Soweit, sogut - das klappt alles bestens
Jetzt möchte ich, dass das Objekt eine Linie zeichnet - also der Objektweg als Linie gezeichnet wird. Dazu bin ich wohl zu blöd ... krieg's einfach net hin.
Wat nu ?!
Das AS ist direkt auf das Movieclip-Objekt gelegt:
onClipEvent (load) {
// declare and set speed variable
//speed = 0.0711; // Screen durch Laufzeit sec.
speed = 1 // Testlauf schneller
diff = 10;
}
onClipEvent (enterFrame) {
// move up and down
if (Key.isDown(Key.UP) && !Key.isDown(Key.DOWN)) {
_y -= diff;
_x += speed;
_rotation = 0;
}
if (Key.isDown(Key.DOWN) && !Key.isDown(Key.UP)) {
_y += diff;
_x += speed;
_rotation = 180;
}
else {
_x += speed;
}
// maintain position and rotation of shadow
with (_root.shadow) {
_x = this._x+3;
_y = this._y+3;
_rotation = this._rotation+90;
}
}
folgendes Problem:
ein Objekt (Grafik als Movieclip deklariert) bewegt sich anhand eines Timerwertes auf der x-Achse von links nach rechts über die Bühne. Mittels Pfeil Rauf/Runter-Tasten kann die y-Position interaktiv geändert werden.
Soweit, sogut - das klappt alles bestens
Jetzt möchte ich, dass das Objekt eine Linie zeichnet - also der Objektweg als Linie gezeichnet wird. Dazu bin ich wohl zu blöd ... krieg's einfach net hin.
Wat nu ?!
Das AS ist direkt auf das Movieclip-Objekt gelegt:
onClipEvent (load) {
// declare and set speed variable
//speed = 0.0711; // Screen durch Laufzeit sec.
speed = 1 // Testlauf schneller
diff = 10;
}
onClipEvent (enterFrame) {
// move up and down
if (Key.isDown(Key.UP) && !Key.isDown(Key.DOWN)) {
_y -= diff;
_x += speed;
_rotation = 0;
}
if (Key.isDown(Key.DOWN) && !Key.isDown(Key.UP)) {
_y += diff;
_x += speed;
_rotation = 180;
}
else {
_x += speed;
}
// maintain position and rotation of shadow
with (_root.shadow) {
_x = this._x+3;
_y = this._y+3;
_rotation = this._rotation+90;
}
}