# Help with sprite bouncing for my mario game!

**URL:** <https://forum.makecode.com/t/help-with-sprite-bouncing-for-my-mario-game/31803>\
**Category:** Arcade\
**Created:** [November 19, 2024, 3:40am UTC](https://forum.makecode.com/t/help-with-sprite-bouncing-for-my-mario-game/31803 "2024-11-19T03:40:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![platformermaster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/platformermaster/32/16102_2.png) [@platformermaster](https://forum.makecode.com/u/platformermaster)\
**Post date:** [November 19, 2024, 3:40am UTC](https://forum.makecode.com/t/help-with-sprite-bouncing-for-my-mario-game/31803/1 "2024-11-19T03:40:16Z")

</div>

Im making a 1-1 replica of mario bros but i need to find a way to make the sprites not bounce up and down, but side to side.

---

<div class="post-metadata">

**Author:** ![anon30657772](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@anon30657772](https://forum.makecode.com/u/anon30657772)\
**Post date:** [November 21, 2024, 3:12am UTC](https://forum.makecode.com/t/help-with-sprite-bouncing-for-my-mario-game/31803/2 "2024-11-21T03:12:22Z")

</div>

If you give your sprites only a horizontal velocity, they should only bounce side to side I think. Do you have an example for what you mean exactly?

---

<div class="post-metadata">

**Author:** ![platformermaster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/platformermaster/32/16102_2.png) [@platformermaster](https://forum.makecode.com/u/platformermaster)\
**Post date:** [November 26, 2024, 12:55am UTC](https://forum.makecode.com/t/help-with-sprite-bouncing-for-my-mario-game/31803/3 "2024-11-26T00:55:10Z")

</div>

Well i need the sprite to also have ay velocity because the enemy needs gravity

---

<div class="post-metadata">

**Author:** ![anon30657772](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@anon30657772](https://forum.makecode.com/u/anon30657772)\
**Post date:** [November 26, 2024, 3:04am UTC](https://forum.makecode.com/t/help-with-sprite-bouncing-for-my-mario-game/31803/4 "2024-11-26T03:04:23Z")

</div>

Ah I see! Well there are two solutions to this:

> Either make the enemies not fall off their platforms (make them go back and forth like [_ **this game** _](https://makecode.com/_KzTcdaCEH3rE))

Or

> You can have invisible walls around your tilemap and have a check if they’re hitting a wall-left or wall-right instead of bounce on wall (Like [_ **this game** _](https://makecode.com/_FXm2CH4h9PMa) – The downside of this is they’ll be turning before reaching the actual edge).

---

<div class="post-metadata">

**Author:** ![platformermaster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/platformermaster/32/16102_2.png) [@platformermaster](https://forum.makecode.com/u/platformermaster)\
**Post date:** [November 26, 2024, 6:06pm UTC](https://forum.makecode.com/t/help-with-sprite-bouncing-for-my-mario-game/31803/5 "2024-11-26T18:06:49Z")

</div>

OK thanks! this helped alot!
