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
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?
Sure! i will paste the share link (btw the game sucks right now) https://arcade.makecode.com/S58310-10223-28059-10450
also, could you translate that to blocks?
If you only need to shoot when walking, this should work:
Link: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?
this should work…
also, for some reason whn my health goes -1 cause i overlapped enemy it game overs me
how to make overlapping a block erase another tile?
Could you send a link or explain it with more detail?
Oh i got it to work sorry
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 ;-;
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.
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.
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.
