- Joined
- Aug 31, 2016
- Messages
- 132
- Reaction score
- 19
- Primarily Uses
Hi!
I need some help.
I've added the mouse plugin, and it seems that I can click on some event and I can make it print the message in the javascript console.
So I know that clicking on the event works every time.
The event is using an actor image, and I set it up as a starting point looking down (the direction).
Now I want that every time I click on the event, it should turn in clock wise direction, first click to the left, second time to go facing up, third click it should go to right and fourth click it should return to the original position (that would be facing down).
The problem is it not working as it should, every click is registered in the console, but it always prints that is facing right over and over again. Also is not really rotating.
I managed to get it rotating if I move my actor around it, it moves only one time, but still can't say why this depends on the actor.
Please help, thanks!
My code is below...

I need some help.
I've added the mouse plugin, and it seems that I can click on some event and I can make it print the message in the javascript console.
So I know that clicking on the event works every time.
The event is using an actor image, and I set it up as a starting point looking down (the direction).
Now I want that every time I click on the event, it should turn in clock wise direction, first click to the left, second time to go facing up, third click it should go to right and fourth click it should return to the original position (that would be facing down).
The problem is it not working as it should, every click is registered in the console, but it always prints that is facing right over and over again. Also is not really rotating.
I managed to get it rotating if I move my actor around it, it moves only one time, but still can't say why this depends on the actor.
Please help, thanks!
My code is below...
◆Comment:click_activate!
◆Script:console.log("clicked");
◆If:This Event is facing Down
◆Script:console.log("clicked event=down");
◆Set Movement Route:This Event
: :◇Turn Left
◆
:Else
◆If:This Event is facing Left
◆Script:console.log("clicked event=left");
◆Set Movement Route:This Event
: :◇Turn Up
◆
:Else
◆If:This Event is facing Up
◆Script:console.log("clicked event=up");
◆Set Movement Route:This Event
: :◇Turn Right
◆
:Else
◆If:This Event is facing Right
◆Script:console.log("clicked event=right");
◆Set Movement Route:This Event
: :◇Turn Down
◆
:End
◆
:End
◆
:End
◆
:End
◆Exit Event Processing
◆Script:console.log("clicked");
◆If:This Event is facing Down
◆Script:console.log("clicked event=down");
◆Set Movement Route:This Event
: :◇Turn Left
◆
:Else
◆If:This Event is facing Left
◆Script:console.log("clicked event=left");
◆Set Movement Route:This Event
: :◇Turn Up
◆
:Else
◆If:This Event is facing Up
◆Script:console.log("clicked event=up");
◆Set Movement Route:This Event
: :◇Turn Right
◆
:Else
◆If:This Event is facing Right
◆Script:console.log("clicked event=right");
◆Set Movement Route:This Event
: :◇Turn Down
◆
:End
◆
:End
◆
:End
◆
:End
◆Exit Event Processing

Last edited by a moderator:
