Play lab - having an actor (ghost) move continuously

Hello!

I have a student playing in Play Lab. She’s trying to have her ghost move continuously throughout the screen. We haven’t had any luck finding a video to help with this. Can anyone offer advice?

Thanks
Karin and student
:slight_smile:

Not sure I’m understanding exactly what you want, but inside the draw loop do something like this

ghost.x = ghost.x + 1; // moves ghost across the screen in a predictable path
if (ghost.x > 400){
ghost.x = 0; // start over when ghost gets to right edge of screen
}

OR

// to move the ghost pseudo randomly on the screen do the following inside the draw loop
ghost.x = randomNumber(0,400); // sets ghost x to random number somewhere on the screen
ghost.y = randomNumber(0,400); // sets ghost y to random number somewhere on the screen

I was thinking game lab not play lab, so this might not work.