# ActionScript 2 TopDown shooter block collisions

**URL:** <https://forum.kirupa.com/t/actionscript-2-topdown-shooter-block-collisions/319062>\
**Category:** Uncategorized\
**Created:** [February 8, 2011, 12:37am UTC](https://forum.kirupa.com/t/actionscript-2-topdown-shooter-block-collisions/319062 "2011-02-08T00:37:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Garb](https://avatars.discourse-cdn.com/v4/letter/g/f6c823/32.png) [@Garb](https://forum.kirupa.com/u/Garb)\
**Post date:** [February 8, 2011, 12:37am UTC](https://forum.kirupa.com/t/actionscript-2-topdown-shooter-block-collisions/319062/1 "2011-02-08T00:37:18Z")

</div>

So, I decided to program a top down shooter in as2, I wrote everything, such as weapons and player movement, but then I came to one necessary thing. Collisions. See, at the moment, I am trying to do this for a wall collision:

```auto

onClipEvent (enterFrame) {
    if (_root.player.hitTest(this))
    {
        _root.player.speed = 0;
        _root.player._y += .6;
    }
    else
    {
        _root.player.speed = 5;
    }
}

```

Now, I realize I am coming at a awkward approach, see- When player touches this specific this, I want it to stop, but be able to move in other directions, such as a real wall. But all that my approach is doing only works on a single side of the block itself. I want all sides of the block to stop player from going through. But I don’t know how. Any Help?
