Forum

Keypressed to move an object

So I have been trying to make a circle move up and down infinite times, so to say when I press the Up key twice the circle moves up by the given amount and for down the same. But I don’t cme further as to move the circle up only onece and move it down only once as well. So how can I repeat the process of moving the object up without being dependent on True or False?

Kind regards

you have to “wrap” your value von -1 to 1 and the other way around. there are several ways to count up and down while wrapping. the two in the screenshot just work with integers. that’s why I count from -10 to 10.

cheers