- Joined
- Apr 10, 2016
- Messages
- 21
- Reaction score
- 2
- Primarily Uses
Hello, could you please advise if there was an easy Javascript option to make an event move twice or more (without coordinates, or RPGMaker MV standard interface)?
A simple script executes the second line immediately (that is logically for JS):
event1 = $gameMap.event(1);
event1.moveStraight(2);
event1.moveStraight(2);
I've already considered setTimeout or setInterval with if-s (presented below). It works, but I would like to learn a simpler option if there is any.
event1 = $gameMap.event(1);
event1.moveStraight(2);
var moveInterval;
moveInterval = setInterval(function()
{
if(event1.isMoving() == false)
{
event1.moveStraight(2);
clearInterval(moveInterval);
}
}, 100
);
Many thanks in advance!
A simple script executes the second line immediately (that is logically for JS):
event1 = $gameMap.event(1);
event1.moveStraight(2);
event1.moveStraight(2);
I've already considered setTimeout or setInterval with if-s (presented below). It works, but I would like to learn a simpler option if there is any.
event1 = $gameMap.event(1);
event1.moveStraight(2);
var moveInterval;
moveInterval = setInterval(function()
{
if(event1.isMoving() == false)
{
event1.moveStraight(2);
clearInterval(moveInterval);
}
}, 100
);
Many thanks in advance!
Last edited by a moderator:

