# Spell Casting with Projectiles

**URL:** <https://forum.makecode.com/t/spell-casting-with-projectiles/45716>\
**Category:** Help\
**Created:** [September 4, 2026, 4:40pm UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716 "2026-09-04T16:40:23Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShadowWhisker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shadowwhisker/32/35148_2.png) [@ShadowWhisker](https://forum.makecode.com/u/ShadowWhisker)\
**Post date:** [September 4, 2026, 4:40pm UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716/1 "2026-09-04T16:40:23Z")

</div>

I am making a dungeon crawler game and i can’t figure out how to get spells to cast properly. I started off by using just projectiles then tried darts but it would not work, spells wont cast in the direction i am facing. i am on a laptop that is not the best so solutions using not much code would be appreciated. Thankssss

---

<div class="post-metadata">

**Author:** ![Soleb244](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Soleb244](https://forum.makecode.com/u/Soleb244)\
**Post date:** [September 4, 2026, 7:59pm UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716/2 "2026-09-04T19:59:14Z")

</div>

If you want it to shoot at an angle, do this:

vx = cos(angle) × speed

vy = sin(angle) × speed

Beware, it uses radians, not degrees. Could you send a link to your project?

---

<div class="post-metadata">

**Author:** ![ShadowWhisker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shadowwhisker/32/35148_2.png) [@ShadowWhisker](https://forum.makecode.com/u/ShadowWhisker)\
**Post date:** [September 4, 2026, 10:11pm UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716/3 "2026-09-04T22:11:24Z")

</div>

Sure! i will paste the share link (btw the game sucks right now) [https://arcade.makecode.com/S58310-10223-28059-10450](https://arcade.makecode.com/S58310-10223-28059-10450)

---

<div class="post-metadata">

**Author:** ![ShadowWhisker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shadowwhisker/32/35148_2.png) [@ShadowWhisker](https://forum.makecode.com/u/ShadowWhisker)\
**Post date:** [September 5, 2026, 6:09am UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716/4 "2026-09-05T06:09:23Z")

</div>

also, could you translate that to blocks?

---

<div class="post-metadata">

**Author:** ![Soleb244](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Soleb244](https://forum.makecode.com/u/Soleb244)\
**Post date:** [September 5, 2026, 6:30pm UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716/5 "2026-09-05T18:30:43Z")

</div>

If you only need to shoot when walking, this should work:

 ![1000030317](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/e/a/ea04f565bee444ed1decf21bdbbbd477cfceb2fe.jpeg)

Link:[https://makecode.com/\_CFs6U5fWM7kE](https://makecode.com/_CFs6U5fWM7kE)

This code isnt the best but its simple and works, but if you wanted to shoot while standing still, it would be a little more complicated with variables, but surely doable. Would you want that or is this enought for your game?

---

<div class="post-metadata">

**Author:** ![ShadowWhisker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shadowwhisker/32/35148_2.png) [@ShadowWhisker](https://forum.makecode.com/u/ShadowWhisker)\
**Post date:** [September 7, 2026, 7:41pm UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716/6 "2026-09-07T19:41:26Z")

</div>

this should work…

---

<div class="post-metadata">

**Author:** ![ShadowWhisker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shadowwhisker/32/35148_2.png) [@ShadowWhisker](https://forum.makecode.com/u/ShadowWhisker)\
**Post date:** [September 8, 2026, 3:31pm UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716/7 "2026-09-08T15:31:11Z")

</div>

also, for some reason whn my health goes -1 cause i overlapped enemy it game overs me

---

<div class="post-metadata">

**Author:** ![ShadowWhisker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shadowwhisker/32/35148_2.png) [@ShadowWhisker](https://forum.makecode.com/u/ShadowWhisker)\
**Post date:** [September 8, 2026, 3:34pm UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716/8 "2026-09-08T15:34:02Z")

</div>

how to make overlapping a block erase another tile?

---

<div class="post-metadata">

**Author:** ![Soleb244](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Soleb244](https://forum.makecode.com/u/Soleb244)\
**Post date:** [September 8, 2026, 6:27pm UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716/9 "2026-09-08T18:27:26Z")

</div>

Could you send a link or explain it with more detail?

---

<div class="post-metadata">

**Author:** ![ShadowWhisker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shadowwhisker/32/35148_2.png) [@ShadowWhisker](https://forum.makecode.com/u/ShadowWhisker)\
**Post date:** [September 8, 2026, 8:43pm UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716/10 "2026-09-08T20:43:33Z")

</div>

Oh i got it to work sorry

---

<div class="post-metadata">

**Author:** ![ShadowWhisker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shadowwhisker/32/35148_2.png) [@ShadowWhisker](https://forum.makecode.com/u/ShadowWhisker)\
**Post date:** [September 8, 2026, 8:46pm UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716/11 "2026-09-08T20:46:36Z")

</div>

however, i insta die when im hit by the tutorial monster, and im not sure why. also, how do i make it vanish when i shoot it ;-;

> **[ShadowCrawl- Main copy](https://arcade.makecode.com/S30885-85429-25749-75386)**
>
> A Dungeon Crawler where you play as a mage, Shadow. My 1st project :)

---

<div class="post-metadata">

**Author:** ![YamJam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yamjam/32/29681_2.png) [@YamJam](https://forum.makecode.com/u/YamJam)\
**Post date:** [September 9, 2026, 2:33am UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716/12 "2026-09-09T02:33:32Z")

</div>

> **[ShadowCrawl- Main copy](https://arcade.makecode.com/15751-14936-35460-62740)**
>
> A Dungeon Crawler where you play as a mage, Shadow. My 1st project :)

Here you go!  
I added the “timers” extensions, which has a few VERY USEFUL blocks that help with cooldowns, timing, and that kind of stuff. Anyways, I added one handler around the damaging code and made it so you can only lose health once every 500 milliseconds.

---

<div class="post-metadata">

**Author:** ![YamJam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yamjam/32/29681_2.png) [@YamJam](https://forum.makecode.com/u/YamJam)\
**Post date:** [September 9, 2026, 5:21pm UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716/13 "2026-09-09T17:21:25Z")

</div>

For the vanishing, you could create another “on overlap” block, and fill out the parameters by making the first sprite your projectile, and the sprite kind the kind of your enemy. Then inside the event add a destroy sprite block and replace the “mySprite” in there with the “othersprite” parameter from the “on overlap” block.

---

<div class="post-metadata">

**Author:** ![ShadowWhisker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shadowwhisker/32/35148_2.png) [@ShadowWhisker](https://forum.makecode.com/u/ShadowWhisker)\
**Post date:** [September 9, 2026, 6:43pm UTC](https://forum.makecode.com/t/spell-casting-with-projectiles/45716/14 "2026-09-09T18:43:35Z")

</div>

oh dang! thank you, this will help much, i should be able to release the finished tutorial now. By the way, i am hosting a Game Jam if you want to join.
