# Art based movement 8 directions

**URL:** <https://forum.kirupa.com/t/art-based-movement-8-directions/260045>\
**Category:** programming\
**Created:** [May 12, 2008, 3:15am UTC](https://forum.kirupa.com/t/art-based-movement-8-directions/260045 "2008-05-12T03:15:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skribble](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Skribble](https://forum.kirupa.com/u/Skribble)\
**Post date:** [May 12, 2008, 3:15am UTC](https://forum.kirupa.com/t/art-based-movement-8-directions/260045/1 "2008-05-12T03:15:48Z")

</div>

**[FIXED] Thanks anyway guys, but I fixed it just then.**

- Hey guys, It’s been a long time since I’ve touched Flash in regards to gaming, but I’ve been wanting to get back in to the scene for a while now, and I started a little project last night and need some help.

I’m wanting to make a simple little art based engine where a character can walk in all directions, much like Double Dragon or Dad’n’Me. I’ve got the walking down fine, it’s just the collision detection between the hero and the walls I am having trouble with. Whenever the hero hits a wall, he flickers back and forth between standing and walking. Now, I know why this is happening, I’m just not sure what other methods I could use.

Ive attached the FLA to this post, and it’s set up very simply, so any help would be great. Cheers.

Code is located on \_root, and on the 2 individual MC’s (“stand” and “run”) inside the HERO MC.\*

---

<div class="post-metadata">

**Author:** ![rrh](https://avatars.discourse-cdn.com/v4/letter/r/67e7ee/32.png) [@rrh](https://forum.kirupa.com/u/rrh)\
**Post date:** [May 12, 2008, 4:23pm UTC](https://forum.kirupa.com/t/art-based-movement-8-directions/260045/2 "2008-05-12T16:23:23Z")

</div>

> Now, I know why this is happening,

Why is this happening?

---

<div class="post-metadata">

**Author:** ![Skribble](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Skribble](https://forum.kirupa.com/u/Skribble)\
**Post date:** [May 13, 2008, 2:58am UTC](https://forum.kirupa.com/t/art-based-movement-8-directions/260045/3 "2008-05-13T02:58:51Z")

</div>

It was because whenever he hit a wall, I was telling him to go back to _heroStand_, and on _heroStand_, if you are pressing a directional key, he is sent back to _heroRu_n. So the result was a constant switching between stand and walk whenever he hit the wall.

To remedy this, I changed the code on _heroStand_ to check for any walls BEFORE sending the hero to heroRun, that way, he just doesn’t move if he is against a wall.
