BestUsername
Member
Okay, I will try to lay out what my exact question is as clearly as I can:
I am making a fighting game.
I have made the camera so that it centers on the two players, and so that each player cannot leave the screen (In the Boundary View 0 Event, I put "x = xprevious").
This works as intended.
I have one problem, though.
Every time a player performs an action of any kind, the shape and size of their hitbox changes.
When a player is standing near the left or right edge of the screen, and they perform an action that results in their hitbox(es) becoming BIGGER than they were previously, they get stuck and cannot move.
This is because their hitbox(es) is/are now intersecting the edge of the view/screen.
What I need to know is:
How can I make it so that, in the Create event, if the player object's hitbox(es) is/are intersecting the edge of the view/screen, they are moved TOWARDS THE CENTER OF THE SCREEN until they are no longer intersecting the edge, so that they can move and don't get stuck because they are intersecting with the edge of the view/screen?
So, if the player is on the right edge of the screen, they need to move to the left until they are no longer colliding with the edge, and vice versa.
How would I go about doing this? Please explain very clearly, as I am not an expert.
Thank you for your help. I hope I explained what I'm trying to do clearly enough.
I am making a fighting game.
I have made the camera so that it centers on the two players, and so that each player cannot leave the screen (In the Boundary View 0 Event, I put "x = xprevious").
This works as intended.
I have one problem, though.
Every time a player performs an action of any kind, the shape and size of their hitbox changes.
When a player is standing near the left or right edge of the screen, and they perform an action that results in their hitbox(es) becoming BIGGER than they were previously, they get stuck and cannot move.
This is because their hitbox(es) is/are now intersecting the edge of the view/screen.
What I need to know is:
How can I make it so that, in the Create event, if the player object's hitbox(es) is/are intersecting the edge of the view/screen, they are moved TOWARDS THE CENTER OF THE SCREEN until they are no longer intersecting the edge, so that they can move and don't get stuck because they are intersecting with the edge of the view/screen?
So, if the player is on the right edge of the screen, they need to move to the left until they are no longer colliding with the edge, and vice versa.
How would I go about doing this? Please explain very clearly, as I am not an expert.
Thank you for your help. I hope I explained what I'm trying to do clearly enough.