Discuss Scratch

squigy123
Scratcher
18 posts

how to make hitbox when mouse controls player direction

In my top down game wherever the mouse is the player points at, my hitbox work fine, but it is easy to turn your mouse while by a wall and get stuck half in the wall, unable to move. Is there any way to fix that?
fubrix
Scratcher
66 posts

how to make hitbox when mouse controls player direction

I don’t understand your question. Maybe tell me the number part of the link to your game and i’ll be able to answer. I would like to help. To me it seems as if you turn and as you turn it goes into the wall. Maybe detect which direction it went into the wall from and undo the movement.
squigy123
Scratcher
18 posts

how to make hitbox when mouse controls player direction

fubrix wrote:

I don’t understand your question. Maybe tell me the number part of the link to your game and i’ll be able to answer. I would like to help. To me it seems as if you turn and as you turn it goes into the wall. Maybe detect which direction it went into the wall from and undo the movement.



yeah thats what im trying to say, but how can i undo the movement? game link: https://scratch.mit.edu/projects/493183002/
squigy123
Scratcher
18 posts

how to make hitbox when mouse controls player direction

squigy123 wrote:

fubrix wrote:

I don’t understand your question. Maybe tell me the number part of the link to your game and i’ll be able to answer. I would like to help. To me it seems as if you turn and as you turn it goes into the wall. Maybe detect which direction it went into the wall from and undo the movement.



yeah thats what im trying to say, but how can i undo the movement? game link: https://scratch.mit.edu/projects/493183002/


Let me explain more, the hitbox works by if it’s touching the wall it stops the movement, simple enough. The player points towards the mouse pointer, and if you get close to wall, and turn to the right, you can put a part of your body into the wall, making you stuck.
fubrix
Scratcher
66 posts

how to make hitbox when mouse controls player direction

Nice game. I noticed that when you get in the wall, sometimes it keeps dragging you until you’re not in the wall. Maybe detect where the player is, the player’s motion, and if they cause movement but it doesn’t change position.

Powered by DjangoBB