semanser
02.06.2012, 14:50
Почему когда я хочу повернуть машыну, то её качество намного падает?
import flash.events.KeyboardEvent;
import fl.transitions.Rotate;
stage.addEventListener(KeyboardEvent.KEY_DOWN, car_move);
stage.addEventListener(KeyboardEvent.KEY_UP, car_stay);
function car_move(e:KeyboardEvent):void
{
trace(e);
if (e.keyCode == 38)
{
car.y = car.y - 4;
car.rotation = -4;
}
if (e.keyCode == 40)
{
car.y = car.y + 4;
car.rotation = +4;
}
if (e.keyCode == 37)
{
car.x = car.x-3;
}
if (e.keyCode == 39)
{
car.x = car.x+5;
}
}
function car_stay(b:KeyboardEvent)
{
if (b.bubbles == true)
{
car.rotation = 0;
}
}
import flash.events.KeyboardEvent;
import fl.transitions.Rotate;
stage.addEventListener(KeyboardEvent.KEY_DOWN, car_move);
stage.addEventListener(KeyboardEvent.KEY_UP, car_stay);
function car_move(e:KeyboardEvent):void
{
trace(e);
if (e.keyCode == 38)
{
car.y = car.y - 4;
car.rotation = -4;
}
if (e.keyCode == 40)
{
car.y = car.y + 4;
car.rotation = +4;
}
if (e.keyCode == 37)
{
car.x = car.x-3;
}
if (e.keyCode == 39)
{
car.x = car.x+5;
}
}
function car_stay(b:KeyboardEvent)
{
if (b.bubbles == true)
{
car.rotation = 0;
}
}