# Code acting weird and I don't know why

**URL:** <https://forum.makecode.com/t/code-acting-weird-and-i-dont-know-why/33199>\
**Category:** Help\
**Created:** [January 17, 2025, 6:21pm UTC](https://forum.makecode.com/t/code-acting-weird-and-i-dont-know-why/33199 "2025-01-17T18:21:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Imconfused](https://avatars.discourse-cdn.com/v4/letter/i/7feea3/32.png) [@Imconfused](https://forum.makecode.com/u/Imconfused)\
**Post date:** [January 17, 2025, 6:21pm UTC](https://forum.makecode.com/t/code-acting-weird-and-i-dont-know-why/33199/1 "2025-01-17T18:21:49Z")

</div>

Im making a driving game for an assignment in one of my classes and for some reason the code for transferring horizontal speed to vertical speed when you turn isn’t adding the full value of the horizontal speed to your vertical speed and it also isnt clearing your horizontal speed. It also recently stopped switching the sprite from the moving down sprite to the moving right sprite and vice versa when you turn to that direction from the other direction.

---

<div class="post-metadata">

**Author:** ![Sonicblaston](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sonicblaston/32/19164_2.png) [@Sonicblaston](https://forum.makecode.com/u/Sonicblaston)\
**Post date:** [January 17, 2025, 6:26pm UTC](https://forum.makecode.com/t/code-acting-weird-and-i-dont-know-why/33199/2 "2025-01-17T18:26:24Z")

</div>

Could you make a share link and post it here? The share button is in the top right of the editor. Paste the link here and I can look at it.

---

<div class="post-metadata">

**Author:** ![Imconfused](https://avatars.discourse-cdn.com/v4/letter/i/7feea3/32.png) [@Imconfused](https://forum.makecode.com/u/Imconfused)\
**Post date:** [January 17, 2025, 6:56pm UTC](https://forum.makecode.com/t/code-acting-weird-and-i-dont-know-why/33199/3 "2025-01-17T18:56:08Z")

</div>

also please do not make any changes to the code as this is a school assignment and I would prefer if you could just tell me how to fix it if possible, however if the only way you can help me fix it is by changing the code I need you to tell me what you changed.

---

<div class="post-metadata">

**Author:** ![Imconfused](https://avatars.discourse-cdn.com/v4/letter/i/7feea3/32.png) [@Imconfused](https://forum.makecode.com/u/Imconfused)\
**Post date:** [January 17, 2025, 6:56pm UTC](https://forum.makecode.com/t/code-acting-weird-and-i-dont-know-why/33199/4 "2025-01-17T18:56:19Z")

</div>

Also, I made a mistake in my first post, so when you turn it didn’t turn any of you horizontal momentum into vertical momentum, I was just accelerating after I turned and thought it was the code.

---

<div class="post-metadata">

**Author:** ![Imconfused](https://avatars.discourse-cdn.com/v4/letter/i/7feea3/32.png) [@Imconfused](https://forum.makecode.com/u/Imconfused)\
**Post date:** [January 17, 2025, 6:58pm UTC](https://forum.makecode.com/t/code-acting-weird-and-i-dont-know-why/33199/5 "2025-01-17T18:58:14Z")

</div>

here you go [https://arcade.makecode.com/S08264-47885-45762-46274](https://arcade.makecode.com/S08264-47885-45762-46274)

---

<div class="post-metadata">

**Author:** ![Imconfused](https://avatars.discourse-cdn.com/v4/letter/i/7feea3/32.png) [@Imconfused](https://forum.makecode.com/u/Imconfused)\
**Post date:** [January 17, 2025, 7:20pm UTC](https://forum.makecode.com/t/code-acting-weird-and-i-dont-know-why/33199/6 "2025-01-17T19:20:56Z")

</div>

I have fixed the issue. It turns out that I set the velocities to the wrong axis and the game wasn’t reading part of my code which i managed to figure out how to fix, sorry for wasting your time.

---

<div class="post-metadata">

**Author:** ![Sonicblaston](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sonicblaston/32/19164_2.png) [@Sonicblaston](https://forum.makecode.com/u/Sonicblaston)\
**Post date:** [January 17, 2025, 7:29pm UTC](https://forum.makecode.com/t/code-acting-weird-and-i-dont-know-why/33199/7 "2025-01-17T19:29:12Z")

</div>

No worries bud 😁 That’s the reason I’m on this forum. Sharing and helping

---

<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:** [January 21, 2025, 5:28pm UTC](https://forum.makecode.com/t/code-acting-weird-and-i-dont-know-why/33199/8 "2025-01-21T17:28:18Z")

</div>

This looks so cool! Can you update the share link when you’re done so we can play? 🤩

---

<div class="post-metadata">

**Author:** ![ShaneyBoi09](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shaneyboi09/32/18893_2.png) [@ShaneyBoi09](https://forum.makecode.com/u/ShaneyBoi09)\
**Post date:** [January 21, 2025, 5:28pm UTC](https://forum.makecode.com/t/code-acting-weird-and-i-dont-know-why/33199/9 "2025-01-21T17:28:45Z")

</div>

Yo, welcome to the forum! I’m ShaneyBoi09!

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [January 21, 2025, 5:32pm UTC](https://forum.makecode.com/t/code-acting-weird-and-i-dont-know-why/33199/10 "2025-01-21T17:32:42Z")

</div>

Always good to have a new member on the forums : ) I fixed my own issue very quickly after joining too!
