OK
El codigo principal de mi pelicula es:
Código :
onClipEvent (enterFrame)
{
function zpomaleni()
{
if (rychlost > 1)
{
rychlost = rychlost * 9.800000E-001;
} // end if
} // End of the function
tellTarget(_root)
{
motorhlas = mot.rychlost * 6 + 20;
song.setVolume(motorhlas);
} // End of TellTarget
if (_root.trat.depo.hitTest(this) && _root.fuel < 10000)
{
_root.fuel = _root.fuel + 20;
_root.trat.depo.play();
} // end if
_root.laps2 = 4 - _root.laps;
if (_root.laps2 > 3)
{
_root.laps2 = 3;
} // end if
if (_root.trat.startcil.hitTest(this) && _root.checkp == 0)
{
_root.checkp = 1;
if (_root.t > 10)
{
_root.laps = _root.laps - 1;
} // end if
if (_root.laps < 1)
{
if (_root.nevyhraje == 1)
{
_root.infopanel.gotoAndPlay(120);
}
else
{
_root.infopanel.gotoAndStop(240);
aux1 = 1;
} // end if
} // end if
}
else if (_root.trat.checkpoint1.hitTest(this) && _root.checkp == 1)
{
_root.checkp = 2;
}
else if (_root.trat.checkpoint2.hitTest(this) && _root.checkp == 2)
{
_root.checkp = 0;
} // end if
maximalka = 300;
_root.speed = Math.round(maximalka / 15 * rychlost);
_root.speed2 = _root.speed + " km/h";
if (Key.isDown(38))
{
_root.fuel = _root.fuel - rychlost / 2;
} // end if
_root.fuel = _root.fuel - 2.000000E-001;
if (_root.fuel <= 0)
{
_root.fuel = 0;
if (_root.infopanel._currentframe == 1)
{
_root.infopanel.gotoAndPlay(2);
} // end if
} // end if
if (_root.fuel < 1000)
{
_root.panel.blik.play();
} // end if
_root.fuel2 = Math.round(_root.fuel / 10000 * 100) + " %";
if (_root._currentframe == 242)
{
if (aux1 != 1)
{
_root.t = _root.t + 2.500000E-002;
_root.t1 = Math.round(_root.t * 10) / 10;
if (_root.t1 == Math.round(_root.t1))
{
_root.t1 = _root.t1 + ".0";
} // end if
} // end if
} // end if
if (Key.isDown(38) && rychlost < 15 && _root._currentframe == 242 && _root.fuel > 0)
{
_root.brzda.gotoAndPlay(4);
if (rychlost < 1.500000E+000)
{
_root.plyn.gotoAndPlay(2);
} // end if
rychlost = rychlost + 3.000000E-003 + (15 - rychlost) / 100;
}
else if (Key.isDown(40) && rychlost > 0)
{
if (rychlost > 6)
{
_root.brzda.gotoAndPlay(2);
} // end if
rychlost = rychlost - 3.000000E-001;
}
else
{
if (rychlost > 0)
{
rychlost = rychlost - 1.000000E-001;
} // end if
if (rychlost < 0)
{
rychlost = 0;
} // end if
} // end if
if (Key.isDown(37) && rychlost > 5.000000E-001)
{
setProperty("", _rotation, _rotation - (30 - rychlost) / 6);
} // end if
if (Key.isDown(39) && rychlost > 0)
{
setProperty("", _rotation, _rotation + (30 - rychlost) / 6);
} // end if
if (_root.trat.walls.hitTest(getBounds(_root).xMax, _y, true))
{
zpomaleni();
} // end if
if (_root.trat.walls.hitTest(getBounds(_root).xMin, _y, true))
{
zpomaleni();
} // end if
if (_root.trat.walls.hitTest(_x, getBounds(_root).yMax, true))
{
zpomaleni();
} // end if
if (_root.trat.walls.hitTest(_x, getBounds(_root).yMin, true))
{
zpomaleni();
} // end if
_root.trat._x = _root.trat._x - rychlost * Math.sin(_rotation * -1 * 1.745329E-002);
_root.trat._y = _root.trat._y - rychlost * Math.cos(_rotation * 1.745329E-002);
}
Hay mas por ahi suelto pero creo que este es el relevante
Muchas Gracias por adelantado
usa las etiquetas code para postear tu codigo