Good day everyone.
A student from my class wants to integrate obstacles into their game that move (up and down, left and right). What is the correct programming for this?
Good day!
Thank you for your question and welcome to the Candli community!
You can do this by combining the “Add speed” and “Stop” blocks. If you want to make a back-and-forth movement, the simplest way is the following code:
It is possible to make more complicated movements using a variable that contains, for example, the direction of movement, or with an animation.
I have made a demo game for you here:
In this demo game, the variable has a play area, but you can use an instance variable to have objects that move at different times.
1 Like
