![]() |
Управление с клавиатуры ... незнаю как... помогите...
Люди добрые помогите... ну не знаю я как заставить двигаться ну хотя бы квадрат... при по мощи клавиатуры. Может напишите скрипт .. а?
Если можно поподробнее, а то я книжки покупал а там как то все... голопом по европе... |
sdela MC i poves kod:
// init variables onClipEvent (load) { hit = new Array("_root.prepon", "_root.prepon1"); scrollStart = false; speedavto = 15; } // // upravlenie // onClipEvent (enterFrame) { if (Key.isDown(Key.LEFT)) { setProperty (this, _x, getProperty(this, _x)-speedavto); _root.avto.dim.gotoAndStop(2); } if (Key.isDown(Key.UP)) { scrollStart = true; _root.d1.d2.groundSpeed = 7; _root.avto.dim.gotoAndStop(2); setProperty (this, _y, getProperty(this, _y)-speedavto); } if (Key.isDown(Key.RIGHT)) { setProperty (this, _x, getProperty(this, _x)+speedavto); _root.avto.dim.gotoAndStop(2); } if (Key.isDown(Key.DOWN)) { _root.avto.dim.gotoAndStop(1); _root.d1.d2.groundSpeed = 0; setProperty (this, _y, getProperty(this, _y)+speedavto*.08); } } // ////////////// // POVOROT // /////////////// onClipEvent (enterFrame) { if (Key.isDown(Key.LEFT)) { setProperty (this, _rotation, -15); } else if (Key.isDown(Key.RIGHT)) { setProperty (this, _rotation, 375); } else { setProperty (this, _rotation, 0); } } // ///////////===================== // HITTEST // /////////========================= onClipEvent (enterFrame) { if (h == 0) { with (vzriv) { gotoAndStop(1); } } for (var i = 0; i<hit.length; i++) { if (this.hitTest(hit[i])) { h = 1; // trace (_root.score); with (vzriv) { gotoAndStop(2); } } else { h = 0; updateAfterEvent(); } } } // ////////////>>>>>>>>>>>>>> // position // //////////>>>>>>>>>>>>>>>> onClipEvent (enterFrame) { if (this._y<-10) { setProperty (this, _y, 400); } else if (this._y>420) { setProperty (this, _y, -10); } if (this._x>335) { setProperty (this, _x, 332); } else if (this._x<49) { setProperty (this, _x, 50); } } nu tak..... tut mnogo lishnego.... ja prosto so svoei igrushki kod vzjal... no rabotat budet |
:D Ну чтоты право слово человека пугаешь :) Хотя...такому нику и отвечать страшно :) А ну как господь накажет.
Ладно для начала вставь в свой квадрат такое. onClipEvent (enterFrame) { _x+=4; _y+=4; } :p |
dik on s klaviaturi hotel.. nu
|
| Часовой пояс GMT +4, время: 06:41. |
Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.