# Pushing Boxes?

**URL:** <https://forum.kirupa.com/t/pushing-boxes/186061>\
**Category:** programming\
**Created:** [April 18, 2006, 7:30pm UTC](https://forum.kirupa.com/t/pushing-boxes/186061 "2006-04-18T19:30:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GDevlin7](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@GDevlin7](https://forum.kirupa.com/u/GDevlin7)\
**Post date:** [April 18, 2006, 7:30pm UTC](https://forum.kirupa.com/t/pushing-boxes/186061/1 "2006-04-18T19:30:26Z")

</div>

I’ve been having a little problem figuring out how to do something on Flash, and I’m hoping somebody here would know =P

Let’s say you have a game with two boxes on screen, one of which the player controls with the arrow keys. The player can also move diagonally.

I’ve been wondering how you can get the player to push the other box in all four directions. Simple eh? I can’t figure it out.

I’m looking for something like this: [http://img133.imageshack.us/my.php?image=pushboxes5ti.swf](http://img133.imageshack.us/my.php?image=pushboxes5ti.swf)  
Except the box won’t rotate, and it moves in only one axis when you push it

Thanks alot if you can help =P

---

<div class="post-metadata">

**Author:** ![Dauntless](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/dauntless/32/749_2.png) [@Dauntless](https://forum.kirupa.com/u/Dauntless)\
**Post date:** [April 18, 2006, 9:01pm UTC](https://forum.kirupa.com/t/pushing-boxes/186061/2 "2006-04-18T21:01:19Z")

</div>

Something like this?

> **[Tile Help!!](https://www.kirupa.com/forum/showthread.php?201743-Tile-Help!!&s=8a927dca4150b5def0a7315cedfbbd78&p=1726334#post1726334)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

---

<div class="post-metadata">

**Author:** ![GDevlin7](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@GDevlin7](https://forum.kirupa.com/u/GDevlin7)\
**Post date:** [April 18, 2006, 9:42pm UTC](https://forum.kirupa.com/t/pushing-boxes/186061/3 "2006-04-18T21:42:06Z")

</div>

Hmm, i was hoping for an art-based engine where you can move sideways =P

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [April 18, 2006, 10:55pm UTC](https://forum.kirupa.com/t/pushing-boxes/186061/4 "2006-04-18T22:55:28Z")

</div>

you could use a while + a hitTest to acheive this;  
[http://www.n99creations.com/?pID=tutorials&col=Blue&tut=basics\_of\_actionscript\_for\_flash&p=9&l=Flash\_MX\_04](http://www.n99creations.com/?pID=tutorials&col=Blue&tut=basics_of_actionscript_for_flash&p=9&l=Flash_MX_04)
