Is there a way to create continous movement in App Lab instead of movement in response to an On Board or On Event? The student is wanting an image to move right along the x axis when the ButtonL is pressed, however if the Toggle Switch is open then it will automatically move to the left along the x axis.
Hopefully that make sense.
To answer your first question, yes you can create continuous movement. Put the x=x+1 type command in the code in a draw loop.
For what your student is trying to do a conditional could work this way:
If pressed it goes right, else it goes left
mwood
October 20, 2021, 3:24am
3
@CeciliaZ is correct for Game Lab. It’s more tricky in App Lab. Here’s a previous thread about continuous motion in App Lab.
Big picture: the topic of animation is a source of confusion both in App Lab AND generally.
Generally speaking you can’t use loops to create animation effects in App Lab - this has to do with the event-driven paradigm of App Lab. If you’re running a loop, that takes over the machine and it can’t do other things in parallel, like listen for events. The source of confusion is of our own making – when you use loops with the Turtle it does cause an animation-like effect. That’s because we did b…
Mike