# Moving platform

**URL:** https://forum.makecode.com/t/moving-platform/985
**Category:** Arcade
**Created:** [January 4, 2020, 4:17pm UTC](https://forum.makecode.com/t/moving-platform/985 "2020-01-04T16:17:26Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![3issa](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/3issa/32/591_2.png) [@3issa](https://forum.makecode.com/u/3issa)
#### Post date: [January 4, 2020, 4:17pm UTC](https://forum.makecode.com/t/moving-platform/985/1 "2020-01-04T16:17:27Z")

</div>

Hi everyone,

I’m making a platformer game following Makecode tutorials on Youtube and docs on [https://arcade.makecode.com/docs](https://arcade.makecode.com/docs) but I’m a little confused with some stuff.

I’m trying to create moving platforms in my game but I can’t manage. I have created a sprite that is actually moving up and down but I can’t figure out how to my hero stay on it. Maybe I need to make a tile instead of a sprite but in that case I don’t know how to move it. Can anyone tell me how to deal with that ?

The second thing that I can’t get over is the use of a personnal palette when you display some auto generated stuff like hearts for level of life or effects or even settings menu. I have change the default palette so the colors of the sprites that I have not made are kind of unexpected…

Thanks for the help you could provide me with.  
3issa

---

<div class="post-metadata">

### Author: ![3issa](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/3issa/32/591_2.png) [@3issa](https://forum.makecode.com/u/3issa)
#### Post date: [January 5, 2020, 10:28am UTC](https://forum.makecode.com/t/moving-platform/985/2 "2020-01-05T10:28:23Z")

</div>

Here is a link to my game in order to understand my problem.

> **[MyPlatformer](https://arcade.makecode.com/91882-30149-11921-75894)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Thanks to the community

---

<div class="post-metadata">

### Author: ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forum.makecode.com/u/kjw)
#### Post date: [January 5, 2020, 2:53pm UTC](https://forum.makecode.com/t/moving-platform/985/3 "2020-01-05T14:53:24Z")

</div>

Your game certainly looks great!

I can’t answer definitively but from what I’ve seen your approach is the one I would try. Tiles have limited resolution for placement so you would never be able to make a platform that gradually moved with a single tile. Perhaps you could do it with 16 tiles of same platform in different vertical positions but that sounds very hacky!

It all looks a bit jerky on the full screen view although I tried it on a PyGamer and it’s far less noticeable on a small screen. I think there’s a minor bug in the system’s camera code causing most of that. There are a few issues with MakeCode Arcade when it comes down to games which need things to work perfectly at the pixel level.

I think I’d be inclined to set the hero `y` value explicitly based on some “sprite touching sprite” code but that’s likely to end up with an ungainly implementation of touching - perhaps overlap will work ok here.

BTW, for `movingClock` variable you can do booleans if you want to. `True` and `False` values are in the `Logic` drawer.

---

<div class="post-metadata">

### Author: ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forum.makecode.com/u/kjw)
#### Post date: [January 5, 2020, 3:32pm UTC](https://forum.makecode.com/t/moving-platform/985/4 "2020-01-05T15:32:06Z")

</div>

I put in [GH: microsoft/pxt-arcade: follow camera on a sprite is jerky under some conditions #1674](https://github.com/microsoft/pxt-arcade/issues/1674) to get the camera following improved.

---

<div class="post-metadata">

### Author: ![3issa](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/3issa/32/591_2.png) [@3issa](https://forum.makecode.com/u/3issa)
#### Post date: [January 5, 2020, 4:10pm UTC](https://forum.makecode.com/t/moving-platform/985/5 "2020-01-05T16:10:10Z")

</div>

Thanks for the feedback. I’m happy that you find my game looking good. I’m really enjoying making it.

Thanks also for your advice, I’ll implement the boolean value for movingClock.

Hope the issue is going to be fixed.

---

<div class="post-metadata">

### Author: ![3issa](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/3issa/32/591_2.png) [@3issa](https://forum.makecode.com/u/3issa)
#### Post date: [January 5, 2020, 5:03pm UTC](https://forum.makecode.com/t/moving-platform/985/6 "2020-01-05T17:03:46Z")

</div>

I have found a way to make it work a bit better. At least, when the platform is moving horizontally, it lools pretty fine to me. I can’t try it on a PyGamer because is not easy to be delivered where I live.  
What I have done :

- sync vy and vx of the hero with the moving platform
- set y of the hero a little higher than the platform
- set ay of the hero to 0
- set the state of the hero to “idle” (no animation)

> **[MyPlatformer](https://arcade.makecode.com/21069-04234-94556-25607)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)
#### Post date: [January 5, 2020, 10:11pm UTC](https://forum.makecode.com/t/moving-platform/985/7 "2020-01-05T22:11:36Z")

</div>

Quick update for the jerkiness with the position offset approach; would require a fix in the ordering of events in the core game loop that is probably better but has to be considered a bit extra. A bit more details [here](https://github.com/microsoft/pxt-arcade/issues/1674#issuecomment-570952715) (also just wanted to comment to say that I love the art in this :))

---

<div class="post-metadata">

### Author: ![3issa](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/3issa/32/591_2.png) [@3issa](https://forum.makecode.com/u/3issa)
#### Post date: [January 26, 2020, 8:36am UTC](https://forum.makecode.com/t/moving-platform/985/8 "2020-01-26T08:36:48Z")

</div>

Just an update to share the last development of the game based on all I have learnt from this forum. Still in progress, there are some bugs that I have to solve.

The game is very playable on an STM32F411 development board.

Very great community. Thanks a lot for the help.

> **[Dungeon of the Ruthless Witch](https://arcade.makecode.com/52604-94547-27781-45731)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<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: [August 29, 2022, 4:18pm UTC](https://forum.makecode.com/t/moving-platform/985/9 "2022-08-29T16:18:43Z")

</div>

This is a fun platformer and great art work!
