# Platform jumper

**URL:** <https://forum.makecode.com/t/platform-jumper/6013>\
**Category:** Arcade\
**Tags:** game\
**Created:** [February 7, 2021, 4:51pm UTC](https://forum.makecode.com/t/platform-jumper/6013 "2021-02-07T16:51:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [February 7, 2021, 4:51pm UTC](https://forum.makecode.com/t/platform-jumper/6013/1 "2021-02-07T16:51:45Z")

</div>

Here is an example of a side scrolling game where the hero jumps over endless platforms.

> **[platform jumper](https://arcade.makecode.com/86434-92370-48110-72719)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

**Customization**  
This game is not using a tilemap, so you can make the game as big as you like. You might also want to have the player shoot projectiles at enemies, perhaps jump over other obstacles.

You can also play the game here: [https://cosmoscowboy.github.io/platform-jumper/](https://cosmoscowboy.github.io/platform-jumper/)  
and also fork the repository: [https://github.com/cosmoscowboy/platform-jumper](https://github.com/cosmoscowboy/platform-jumper)

Have fun customizing the game. Please let me know if you have any questions on the game mechanics, and ways of improving it.

---

<div class="post-metadata">

**Author:** ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)\
**Post date:** [February 7, 2021, 9:29pm UTC](https://forum.makecode.com/t/platform-jumper/6013/2 "2021-02-07T21:29:00Z")

</div>

What math do you use for collisions?

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [February 8, 2021, 9:27pm UTC](https://forum.makecode.com/t/platform-jumper/6013/3 "2021-02-08T21:27:53Z")

</div>

I don’t use any math.

At the start of the game a place sprites until the width of the screen and place the player on top of one. I then set the ay of the player to a positive value so that it falls. In the method ‘checkPlayer’ I check if the player is overlapping one of the ‘platform’ sprites, and if so, move the player up one pixel at time until the bottom of the player is less the the platform it hits. At this point, I set the vy & ay to zero so the player is no longer falling. When the player jumps, I see ay again so the player eventually falls again.

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

---

<div class="post-metadata">

**Author:** ![NxNMatrixGL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/nxnmatrixgl/32/2553_2.png) [@NxNMatrixGL](https://forum.makecode.com/u/NxNMatrixGL)\
**Post date:** [February 8, 2021, 10:05pm UTC](https://forum.makecode.com/t/platform-jumper/6013/4 "2021-02-08T22:05:21Z")

</div>

This maybe by design, I’m not sure. I noticed you can wait long enough to let the player begin to fall between two platforms and when it seems it should irrevocably fall down, you can jump up “mid air”.
