# I need help with some limit setting

**URL:** <https://forum.kirupa.com/t/i-need-help-with-some-limit-setting/68980>\
**Category:** Uncategorized\
**Created:** [October 30, 2004, 11:42pm UTC](https://forum.kirupa.com/t/i-need-help-with-some-limit-setting/68980 "2004-10-30T23:42:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoMan](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@JoMan](https://forum.kirupa.com/u/JoMan)\
**Post date:** [October 30, 2004, 11:42pm UTC](https://forum.kirupa.com/t/i-need-help-with-some-limit-setting/68980/1 "2004-10-30T23:42:26Z")

</div>

Hi,

I am having some difficulties on the collision setting for the limits in my game. When the hero jumps onto the ground, he either lands perfectly on it, or just above it. My ActionScript for the limits is the following:

```auto

function collision() {
    with (hero) {
        if (limits.hitTest(_x, _y, true)) {
            _x -= 3;
        }

        if (limits.hitTest(_x, _y, true)) {
            _x += 3;
        }

        if (limits.hitTest(_x, _y, true)) {
            _y -= 10;
            jumping = false;
        }

        if (limits.hitTest(_x, _y, true)) {
            _y += 5;   
        }
    }
}

```

If anyone has any help or suggestions, it would be greatly appreciated. Thanks.

Sincerely,

JoMan
