# Test Arcade Game

**URL:** <https://forum.makecode.com/t/test-arcade-game/17768>\
**Category:** Help\
**Tags:** make, game\
**Created:** [February 3, 2023, 6:29pm UTC](https://forum.makecode.com/t/test-arcade-game/17768 "2023-02-03T18:29:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drojal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/drojal/32/7377_2.png) [@Drojal](https://forum.makecode.com/u/Drojal)\
**Post date:** [February 3, 2023, 6:29pm UTC](https://forum.makecode.com/t/test-arcade-game/17768/1 "2023-02-03T18:29:11Z")

</div>

When I press the right button for example, the player doesn’t head to the right side immediately.

Also, when I press the left button and after some ms I release it, my character is animated as he still moves to the left even if I have released the left button. It doesn’t happen with the rest move buttons.

Moreover, I want my character to be animated, while he uses his sword or shield (A and B button respectively) even when he is stationary. For now he is animated only when I move and use the A or B button. My code for this is in the orange blocks to the right hand side.

This is my code: [https://arcade.makecode.com/S34570-14289-56605-84829](https://arcade.makecode.com/S34570-14289-56605-84829)

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [February 3, 2023, 7:35pm UTC](https://forum.makecode.com/t/test-arcade-game/17768/2 "2023-02-03T19:35:38Z")

</div>

I think a lot of your problems will be solved by using the arcade-character-animations extension:

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/b42d89becc235065f4b147d1c8f4bbce1f3a12ea.png)

With that extension you can make it so that the sprites animate using simple rules like “facing left” or “facing right”:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/2/2ea15d8f4501deaa813c18f6c47e48535aebd671.png)

Also it looks like you are manually checking for overlaps inside of a forever. It’s much easier to use overlap events:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/8/84d2eaf1cb1ae51e1634064d2b6fcbb65616971f.png)

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [February 3, 2023, 7:37pm UTC](https://forum.makecode.com/t/test-arcade-game/17768/3 "2023-02-03T19:37:36Z")

</div>

Also, here’s a trick I use to code sword/shield type games:

> [@Coding a sword type weapon?](https://forum.makecode.com/t/coding-a-sword-type-weapon/847):
>
> Hello, I am looking to code a sword or other weapon that my sprite can swing. I want the sword to be able to destroy enemies it hits but am struggling to find a good way to do so. So far I have made the sword a projectile but am looking for other ideas. I know that making a firing projectile would be easier but I have done that in another game. Thanks for your help

---

<div class="post-metadata">

**Author:** ![Drojal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/drojal/32/7377_2.png) [@Drojal](https://forum.makecode.com/u/Drojal)\
**Post date:** [February 10, 2023, 5:44pm UTC](https://forum.makecode.com/t/test-arcade-game/17768/4 "2023-02-10T17:44:31Z")

</div>

So before every animation that I have right now in my code, I just use the animation extension that you sent me? Also, by saying that I check manually the overlaps, you mean the “if” that I use?

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [February 10, 2023, 5:56pm UTC](https://forum.makecode.com/t/test-arcade-game/17768/5 "2023-02-10T17:56:45Z")

</div>

yes, exactly! The overlap event blocks are more efficient and easier to use than checking overlaps with if statements in a bunch of places. They also guarantee that your overlap code will run at the right time in [the game loop](https://arcade.makecode.com/developer/game-loop)
