Hey there! I’m new to MakeCode arcade and to this forum. But I’m trying to make a game for class and I need some help with a core feature.
I wanted to make a game similar to the DVD screensaver. There’s a thing bouncing around, and you want it to hit the corners. You have a sprite that you can use to guide it. My idea was that when your sprite collided with the other one, it would bounce off of you, allowing you to send it towards the corners. Unfortunately, I can’t figure out how to make the sprites bounce off each other.
I was quickly able to get the screensaver sprite to bounce off the walls. It hits the corners on its own eventually, but I wanted it to bounce off the player so there would be some gameplay. I’ve tried a couple things, and none of them have worked. I tried to make it so that collisions would reverse the screensaver sprite’s x and y velocity, but that just sent it exactly back to where it came from. It’s useless for redirecting it. I tried a bunch of random math, subtracting and adding and dividing zeroes and player velocities and screensaver velocities. Those either froze the screensaver (when the player velocity was 0) or wildly sped it up (when the player velocity wasn’t zero.)
I don’t know if this is a realistic goal, but I’m wondering if anyone knows how to make sprites bounce off each other. Is there something that I’m missing?