Greetings!
:medieval:
I'm trying to get my player object to reverse direction when going off screen, but it's not quite working.
I was using the [Reverse Horizontal] and [Reverse Vertical] actions in the [Outside Room] event, and it actually works...partly.
When I move off of the screen, it reverses based on the direction that I came from, but does not reverse the sprite so that it faces the new direction (so, I fly off of the left side of the screen, facing left, it reverses the object so that I travel to the right after the reverse...but the sprite still faces left).
I understand that GM can't understand that I need to reverse the sprite, so what I wanted to do was create a script that did it, sort of like this (silly psuedocode):
If player object goes off the top side of the screen
{
Divide player object's sprite by 2 // 360 subimages for player sprite, 0 faces up.
Reverse player object's direction
}
If player object goes off the left side of the screen
{
Divide player object's sprite by 2 // 360 subimages for player sprite, 0 faces up.
Reverse player object's direction
}
If player object goes off the bottom side of the screen
{
Divide player object's sprite by 2 // 360 subimages for player sprite, 0 faces up.
Reverse player object's direction
}
If player object goes off the right side of the screen
{
Divide player object's sprite by 2 // 360 subimages for player sprite, 0 faces up.
Reverse player object's direction
}
The thing is, I can't seem to find any kind of boundary detection in the help file or here in the forums. I understand that "Outside Room" event, by definition, detects this...but I'm trying to find out which direction the player was facing so that I can try to reverse it...and since I can't find any properties relating to this, I can't attempt it in an IF statement :blink:
Does anyone have any thoughts on how to accomplish this?
:medieval:
I'm trying to get my player object to reverse direction when going off screen, but it's not quite working.
I was using the [Reverse Horizontal] and [Reverse Vertical] actions in the [Outside Room] event, and it actually works...partly.
When I move off of the screen, it reverses based on the direction that I came from, but does not reverse the sprite so that it faces the new direction (so, I fly off of the left side of the screen, facing left, it reverses the object so that I travel to the right after the reverse...but the sprite still faces left).
I understand that GM can't understand that I need to reverse the sprite, so what I wanted to do was create a script that did it, sort of like this (silly psuedocode):
If player object goes off the top side of the screen
{
Divide player object's sprite by 2 // 360 subimages for player sprite, 0 faces up.
Reverse player object's direction
}
If player object goes off the left side of the screen
{
Divide player object's sprite by 2 // 360 subimages for player sprite, 0 faces up.
Reverse player object's direction
}
If player object goes off the bottom side of the screen
{
Divide player object's sprite by 2 // 360 subimages for player sprite, 0 faces up.
Reverse player object's direction
}
If player object goes off the right side of the screen
{
Divide player object's sprite by 2 // 360 subimages for player sprite, 0 faces up.
Reverse player object's direction
}
The thing is, I can't seem to find any kind of boundary detection in the help file or here in the forums. I understand that "Outside Room" event, by definition, detects this...but I'm trying to find out which direction the player was facing so that I can try to reverse it...and since I can't find any properties relating to this, I can't attempt it in an IF statement :blink:
Does anyone have any thoughts on how to accomplish this?