OwlShield

FlashDersleriniz

Aug 28th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. onClipEvent (load) {
  2.  var hiz:Number = 5;
  3.  var Yukseklik:Number = _height/2;
  4.  var Yataylik:Number = _width/2;
  5. }
  6. onClipEvent (enterFrame) {
  7.  while (_root.mcDuvar.hitTest(this._x, this._y-Yukseklik, true)) {
  8.   _y += hiz;
  9.  }
  10.  while (_root.mcDuvar.hitTest(this._x, this._y+Yukseklik, true)) {
  11.   _y -= hiz;
  12.  }
  13.  while (_root.mcDuvar.hitTest(this._x+Yataylik, this._y, true)) {
  14.   _x -= hiz;
  15.  }
  16.  while (_root.mcDuvar.hitTest(this._x-Yataylik, this._y, true)) {
  17.   _x += hiz;
  18.  }
  19.  if (Key.isDown(Key.UP)) {
  20.   _y -= hiz;
  21.  }
  22.  if (Key.isDown(Key.DOWN)) {
  23.   _y += hiz;
  24.  }
  25.  if (Key.isDown(Key.RIGHT)) {
  26.   _x += hiz;
  27.  }
  28.  if (Key.isDown(Key.LEFT)) {
  29.   _x -= hiz;
  30.  }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment