# Can any one help with my game

**URL:** <https://forum.makecode.com/t/can-any-one-help-with-my-game/36431>\
**Category:** Help\
**Created:** [May 7, 2025, 4:08am UTC](https://forum.makecode.com/t/can-any-one-help-with-my-game/36431 "2025-05-07T04:08:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Technopog](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/technopog/32/22124_2.png) [@Technopog](https://forum.makecode.com/u/Technopog)\
**Post date:** [May 7, 2025, 4:08am UTC](https://forum.makecode.com/t/can-any-one-help-with-my-game/36431/1 "2025-05-07T04:08:49Z")

</div>

so I have been making a space related game and m trying to figure out how to make the “moon” sprite to orbit the “earth” sprite while also moving with the earth sprite if you move the earth sprite if you want or need to here is my game (it is not done and most of the code is not placed down yet) at the start it is a player select so idk if that will make it harder or not.

> **[Space Maybe rpg idk](https://arcade.makecode.com/S39117-71581-07321-29326)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Also what should I do for the other charecters

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [May 7, 2025, 6:44pm UTC](https://forum.makecode.com/t/can-any-one-help-with-my-game/36431/2 "2025-05-07T18:44:51Z")

</div>

You should be able to use Cos and Sin math functions to make the sprite orbit. Cos and Sin take in a variable and output a variable. The input is the rotation in radians, and the output is the x/y position of a point around a circle with radius 1. Cos is x, Sin is y. Basically, you would have a variable like “rotation” and in a forever loop you can set the moon sprite position like

Set moon.x = earth.x + (multiplier • Cos(rotation) )  
Set moon.y = earth.y + (multiplier • Sin(rotation) )

The “multiplier” is the distance from the earth you want it to rotate. Since rotation in radians means 360 degrees is the same as 2pi, every frame you should be increasing the rotation variable by a very small amount, like 0.05 or something. That way the orbit is slow.

---

<div class="post-metadata">

**Author:** ![BotWarrior](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/botwarrior/32/25328_2.png) [@BotWarrior](https://forum.makecode.com/u/BotWarrior)\
**Post date:** [May 7, 2025, 6:48pm UTC](https://forum.makecode.com/t/can-any-one-help-with-my-game/36431/3 "2025-05-07T18:48:11Z")

</div>

You could try the sprite utils extension, it allows you to place sprites a distance and angle from another sprite. It can also do a bunch of other stuff. Hope that helps

---

<div class="post-metadata">

**Author:** ![BUM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bum/32/22127_2.png) [@BUM](https://forum.makecode.com/u/BUM)\
**Post date:** [May 8, 2025, 8:50pm UTC](https://forum.makecode.com/t/can-any-one-help-with-my-game/36431/4 "2025-05-08T20:50:00Z")

</div>

[game with moon code](https://makecode.com/_YwwgfX9fX8t6) I tried to come up with a solution but It’s kind of choppy and the why I had it before left the moon behind

---

<div class="post-metadata">

**Author:** ![Technopog](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/technopog/32/22124_2.png) [@Technopog](https://forum.makecode.com/u/Technopog)\
**Post date:** [May 8, 2025, 9:07pm UTC](https://forum.makecode.com/t/can-any-one-help-with-my-game/36431/5 "2025-05-08T21:07:14Z")

</div>

well that is good for now but now idk what to do with the rest of the characters

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [May 8, 2025, 9:12pm UTC](https://forum.makecode.com/t/can-any-one-help-with-my-game/36431/6 "2025-05-08T21:12:28Z")

</div>

> **[Space Maybe rpg idk(with moon)](https://arcade.makecode.com/S99472-55371-76700-12486)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

I implemented that solution I was talking about. It looks really good. Good luck with the rest of your game!

---

<div class="post-metadata">

**Author:** ![Technopog](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/technopog/32/22124_2.png) [@Technopog](https://forum.makecode.com/u/Technopog)\
**Post date:** [May 8, 2025, 9:12pm UTC](https://forum.makecode.com/t/can-any-one-help-with-my-game/36431/7 "2025-05-08T21:12:41Z")

</div>

or what should I do with the game

---

<div class="post-metadata">

**Author:** ![Technopog](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/technopog/32/22124_2.png) [@Technopog](https://forum.makecode.com/u/Technopog)\
**Post date:** [May 9, 2025, 5:49pm UTC](https://forum.makecode.com/t/can-any-one-help-with-my-game/36431/8 "2025-05-09T17:49:35Z")

</div>

[https://arcade.makecode.com/S79608-29573-59517-79249](https://arcade.makecode.com/S79608-29573-59517-79249) here is updated game
