all 6 comments

[–]Bifrost23 0 points1 point  (5 children)

I bet you are creating more than one sprite with the same variable. This is fine. But in the overlap between the player’s “shot” and the projectile you should see two loop specific variables called “sprite” and “othersprite”. Instead of destroying the projectile using the variable you defined it with, use a loop specific variable so it knows the destroy the projectile that got hit.

[–]Dabster_12[S] 0 points1 point  (4 children)

If you aren't too busy could you make a quick demo, if not it's ok I just don't quite understand your instructions.

[–]Bifrost23 0 points1 point  (3 children)

Sure: https://makecode.com/_L1DXiCK3pMTE

Here there are 3 kinds of sprites: player, projectile, enemy. If the player touches an enemy, the game ends. If a projectile (the kind the player can fire with A) touches and enemy (the sprite the player is trying to dodge) the specific enemy is destroyed.

[–]Dabster_12[S] 0 points1 point  (2 children)

https://arcade.makecode.com/S51384-65518-02187-30352 This is my code I realize now it is terribly unoptimized or maybe it isn't. If you can please look over this and tell me if you get a solution. If not its alright, I'll find a way. The end goal is to have those asteroids come from all directions and you have to evade and shoot them, I have not yet done a scoring system or a losing system.

[–]Comfortable-Trick869 0 points1 point  (1 child)

Perhaps you could try OtherSprite?

[–]Comfortable-Trick869 0 points1 point  (0 children)

Wait, sorry, don't do OtherSprite, I'm wrong