Показать сообщение отдельно
Старый 30.09.2002, 10:32
Wolodia вне форума Посмотреть профиль Отправить личное сообщение для Wolodia Найти все сообщения от Wolodia
  № 8  
Wolodia

Регистрация: Mar 2002
Адрес: и не проживаЄт
Сообщений: 58
Tip в Flash MX Tutorials|Maze

Возможность FlashMX



onClipEvent (enterFrame) {
if (_root.started && _root._currentframe==1) {
with (_root.square) {
//
// keyboard controls
if (Key.isDown(Key.DOWN)) {
_y += 1;
}
if (Key.isDown(Key.UP)) {
_y -= 1;
}
if (Key.isDown(Key.LEFT)) {
_x -= 1;
}
if (Key.isDown(Key.RIGHT)) {
_x += 1;
}
//
// detect if edges of the player square are colliding with the maze walls
if (walls.hitTest(getBounds(_root).xMax, _y, true)) {
_x -= 1;
}
if (walls.hitTest(getBounds(_root).xMin, _y, true)) {
_x += 1;
}
if (walls.hitTest(_x, getBounds(_root).yMax, true)) {
_y -= 1;
}
if (walls.hitTest(_x, getBounds(_root).yMin, true)) {
_y += 1;
}
//
// detect if maze is finished
if (_root.goal.hitTest(_x, getBounds(_root).yMax, true)) {
_root.gotoandstop(3);
}
}
}
}