ActionScript:
// Auto, Obejekt
Spieler = new Object();
// Ausgangswerte
Spieler.init = function (clip)
{
with (clip)
{
maxtempo = 10
tempoH = 0
tempoV = 0
}
}
Spieler.steuern = function (clip)
{
with (clip)
{
// 1. Bewegung
_x += tempoH;
_y += tempoV
// 2. Beschleunigen
if (Key.isDown(Key.RIGHT) && tempoH < maxTempo)
{
tempoH += 1.0;
_rotation = 90
}
if (Key.isDown(Key.LEFT) && tempoH > -maxTempo)
{
tempoH += 1.0
_rotation = -90
}
if (Key.isDown(Key.UP) && tempoV > -maxtempo)
{
tempoV -= 1.0
_rotation = 0
}
if (Key.isDown(Key.DOWN) && tempoV < maxtempo)
{
tempoV += 1.0
_rotation = 0
}
// 3. Diagonal
if (Key.isDown(Key.LEFT) && Key.isDown(Key.UP))
{
_rotation = -45
}
if (Key.isDown(Key.LEFT) && Key.isDown(Key.DOWN))
{
_rotation = -135
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.DOWN))
{
_rotation = 135
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.UP))
{
_rotation = 45
}
// 4. Abbremsen
if (tempoH > 0.0)
{
tempoH -= 0.25
}
if (tempoH < 0.0)
{
tempoH += 0.25
}
if (tempoV > 0.0)
{
tempoV -= 0.25
}
if (tempoV < 0.0)
{
tempoV += 0.25
}
}
}
Spieler.init;
this.Spieler.onEnterFrame = function ()
{
Spieler.steuern
}
was ist falsch? ich hab das in nem frame programmiet, und dann auf einen mc zugegriffen, was ist da der fehler?