# Black hole like physics

**URL:** <https://forum.makecode.com/t/black-hole-like-physics/35981>\
**Category:** Help\
**Tags:** game\
**Created:** [April 21, 2025, 2:35am UTC](https://forum.makecode.com/t/black-hole-like-physics/35981 "2025-04-21T02:35:14Z")\
**Posts on this page:** 5\
**Page:** 1

<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:** [April 21, 2025, 2:35am UTC](https://forum.makecode.com/t/black-hole-like-physics/35981/1 "2025-04-21T02:35:14Z")

</div>

So I have been doing this thing where I try to work out how to have objects that… I better show my project. Keep in mind that I don’t want to also calculate distance from my black hole to my red ball. Just velocity.

> **[black hole physics](https://arcade.makecode.com/S40805-32199-96580-24641)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

The problem seems to be when the ball gets into other “quadrants” . Would love your opinion

---

<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:** [April 23, 2025, 1:53am UTC](https://forum.makecode.com/t/black-hole-like-physics/35981/2 "2025-04-23T01:53:08Z")

</div>

The main problem here is that you are always _adding_ to the angle. This is always going to make the sprite turn differently depending on if it’s traveling right or left. What you should be doing is making the sprite lose velocity in other directions while gaining velocity towards the black hole. Since you don’t want to calculate the distance to the black hole (for some reason) the amount of speed you want to add to the sprite is going to be a constant, so it will look a bit weird.

---

<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:** [April 23, 2025, 12:24pm UTC](https://forum.makecode.com/t/black-hole-like-physics/35981/3 "2025-04-23T12:24:37Z")

</div>

Ah… I get it. I don’t know how to do that though. Could you maybe show me how?

---

<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:** [April 23, 2025, 3:41pm UTC](https://forum.makecode.com/t/black-hole-like-physics/35981/4 "2025-04-23T15:41:02Z")

</div>

> **[(correct) black hole physics](https://arcade.makecode.com/S17610-44933-70430-39752)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Here ya go. If you want it to be fast or slower you can divide or multiply the output of those Cos and Sin blocks.

---

<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:** [April 23, 2025, 8:50pm UTC](https://forum.makecode.com/t/black-hole-like-physics/35981/5 "2025-04-23T20:50:19Z")

</div>

Thanks so much!
