# Boundary

**URL:** <https://forum.kirupa.com/t/boundary/125962>\
**Category:** Uncategorized\
**Created:** [October 19, 2004, 11:57am UTC](https://forum.kirupa.com/t/boundary/125962 "2004-10-19T11:57:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hitman1131](https://avatars.discourse-cdn.com/v4/letter/h/7ba0ec/32.png) [@hitman1131](https://forum.kirupa.com/u/hitman1131)\
**Post date:** [October 19, 2004, 11:57am UTC](https://forum.kirupa.com/t/boundary/125962/1 "2004-10-19T11:57:28Z")

</div>

hey guys im trying to make a little birds eye view game but i cant seem to get a bounary on the border to work to stop my character walking off the stage…

this is the codee i am using how can i put a boundary into it?

onClipEvent (enterFrame) {

if (Key.isDown(Key.UP)){  
speed += 1;  
gotoAndStop (2)  
} else {  
gotoAndStop (1)  
speed = 0}

if (Key.isDown(Key.DOWN)) {  
speed -= 0;  
}  
if (Math.abs(speed)\>8) {  
speed \*= .8;  
}  
if (Key.isDown(Key.LEFT)) {  
\_rotation -= 10;  
}  
if (Key.isDown(Key.RIGHT)) {  
\_rotation += 10;  
}

// This will make the car move  
speed _= .98;  
x = Math.sin(\_rotation_(Math.PI/180))_speed;  
y = Math.cos(\_rotation_(Math.PI/180))_speed_-1;  
if (!\_root.wall.hitTest(\_x+x, \_y+y, true)) {  
\_x += x;  
\_y += y;  
} else {  
speed \*= -.8;  
}  
}
