# Movement code AS 1.0-2.0 Conversion Help

**URL:** https://forum.kirupa.com/t/movement-code-as-1-0-2-0-conversion-help/197560
**Category:** programming
**Created:** [August 17, 2006, 1:05pm UTC](https://forum.kirupa.com/t/movement-code-as-1-0-2-0-conversion-help/197560 "2006-08-17T13:05:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Lord\_Impero](https://avatars.discourse-cdn.com/v4/letter/l/e5b9ba/32.png) [@Lord\_Impero](https://forum.kirupa.com/u/Lord_Impero)
#### Post date: [August 17, 2006, 1:05pm UTC](https://forum.kirupa.com/t/movement-code-as-1-0-2-0-conversion-help/197560/1 "2006-08-17T13:05:53Z")

</div>

Hi guys,  
I have a code in as 1 and was hoping whether someone could help me mekae it as 2

```auto
onClipEvent (load) {
 s = 15;
 b=this.getBounds()
 function move(x, y) {
  if (!hit.hitTest(_x+x+b.xmin+1, _y+y+b.ymin+1, true)) {
   if (!hit.hitTest(_x+x+b.xmax-1, _y+y+b.ymin+1, true)) {
    if (!hit.hitTest(_x+x+b.xmin+1, _y+y+b.ymax-1, true)) {
     if (!hit.hitTest(_x+x+b.xmax-1, _y+y+b.ymax-1, true)) {
      _x += x;
      _y += y;
     }
    }
   }
  }
 }
}
onClipEvent (enterFrame) {
 if (Key.isDown(Key.UP)) {
  move(0, -s);
 }
 if (Key.isDown(Key.DOWN)) {
  move(0, s);
 }
 if (Key.isDown(Key.LEFT)) {
  move(-s, 0);
 }
 if (Key.isDown(Key.RIGHT)) {
  move(s, 0);
 }
}

```

Thanks in Advance!  
Impero
