Reflection character puzzle

In my game I plan on having a puzzle where you have guide an event to certain spot on the map. The event moves in the opposite direction as you do. I was wondering how would I prevent the event from moving if you the player can't move. Whenever I am pressed against and continue to push a directional key the event moves regardless of the fact I am stuck.
@KazukiT Are you using a plugin to cause the event to mirror the movements of the player? Or are you using event commands? If you are using event commands, could you share the event code?
@KazukiT Are you using a plugin to cause the event to mirror the movements of the player? Or are you using event commands? If you are using event commands, could you share the event code?

I am using an event commands to mirror their movements. Here's the code I am using. I have this event set as a Parallel Process.
@KazukiT Create a new Conditional Branch and move the event commands that you have inside. Set the branch to check against the following code :

Code:
$gamePlayer.isMoving()

So, it should all look like the following :

Code:
◆If:Script:$gamePlayer.isMoving()
  ◆If:Button [Up] is pressed down
    ◆Set Movement Route:This Event (Wait)
    :                  :◇Move Down
    ◆
  :End
  ◆If:Button [Down] is pressed down
    ◆Set Movement Route:This Event (Wait)
    :                  :◇Move Up
    ◆
  :End
  ◆If:Button [Left] is pressed down
    ◆Set Movement Route:This Event (Wait)
    :                  :◇Move Right
    ◆
  :End
  ◆If:Button [Right] is pressed down
    ◆Set Movement Route:This Event (Wait)
    :                  :◇Move Left
    ◆
  :End
  ◆
:End
@KazukiT Create a new Conditional Branch and move the event commands that you have inside. Set the branch to check against the following code :

Code:
$gamePlayer.isMoving()

So, it should all look like the following :

Code:
◆If:Script:$gamePlayer.isMoving()
  ◆If:Button [Up] is pressed down
    ◆Set Movement Route:This Event (Wait)
    :                  :◇Move Down
    ◆
  :End
  ◆If:Button [Down] is pressed down
    ◆Set Movement Route:This Event (Wait)
    :                  :◇Move Up
    ◆
  :End
  ◆If:Button [Left] is pressed down
    ◆Set Movement Route:This Event (Wait)
    :                  :◇Move Right
    ◆
  :End
  ◆If:Button [Right] is pressed down
    ◆Set Movement Route:This Event (Wait)
    :                  :◇Move Left
    ◆
  :End
  ◆
:End
I put in the code and worked like a charm. Thanks for the help 🙂
Since you're not using a plugin, this doesn't belong in Plugin Support.

I've moved this thread to MV Support. Thank you.


If your query is fully solved, please report your post and we'll close this topic.

Original thread: https://forums.rpgmakerweb.com/threads/reflection-character-puzzle.113896/