Hello! It's been a while.
I promised that I would have noticy you for updates.
Here's a short recap for whoever is reading:
I'm making a top-down game in 4 directions.
You're a robot vacuum cleaner, and your objective is to pick up the dust in levels.
The robot will move automatically, while the player will just adjust the angle of direction, between up (270°), down (90°), right (0°), and left (180°).
When the player hits a wall (either invisible or not), the robot "reflects" the direction.
For example, if the player's direction is set to "right" and bounces on a wall, the new direction is set to "left".
I had to make this premise because up to this moment, everything works as intended.
I still want to thank R0J0hound for the suggestion.
I still have their event. But there is a so-called bug I can't fix and is probably related to how the robot works.
If the player spams against a wall in one direction, in a way or another, it will get stuck (if overlapping) or pass through it (if on collision). This happens only if the player makes a stress test, but I bet someone will do it just fine.
Here you can see two videos:
- dropbox.com/s/swrg9sarf9al9bl/10.06%20issue%20on%20collission.mp4 (collision)
- dropbox.com/s/nu0az130nzbdjpm/10.06%20issue%20overlapping.mp4 (overlap)
Is there any way to fix this? Thank you.
UPDATE: Hello! Ok so, I say this for me and for the others as well:
It's possible that I've fixed it by changing a parameter.
If you look at R0J0hound's comment:
"——— sprite: move 1 pixel at angle self.ang."
I've changed from 1 pixel to 15, to leave enough space to not get stuck with the wall.