It looks like you're new here. If you want to get involved, click one of these buttons!
Can we do "Wait" in Codea? For example: the train goes, then stops, then waits 10 second, and then goes again. If it is possible, can you tell and show me? Please.
Comments
@AYKostarev If you use physics objects, you can use pause to stop them. But for normal code, there isn't a Wait function. But that doesn't mean you can't do a wait. Depending on what you're doing, you can write your code to allow a simulated wait. The draw() function runs 60 times per second and there's no way to stop it. That's the function that normally drives your code. Without knowing exactly what you want to do, I can't tell you how to do it. But here's a simple example that might help.
@AYKostarev - And here's a variation that waits 10 seconds whenever you touch the screen
Thank you
This is an example @AYKostarev. This example shows a way with only draw
@TokOut Putting everything in draw isn't a very good idea. You're executing code 60 times per second that doesn't need to be done over and over. The purpose of the setup() function is to execute code that only needs to be run 1 time. The code below that's in your program only needs to be run once and not 60 times per second. Also, it's not a good idea to compare a number to an exact value as in
if countdown == 10 then
when you're adding fractions to it. When you add .05 to countdown, on my iPad Air, countdown is never equal to 10 and the program doesn't do what you intend it to do. When countdown is supposed to be 10, the difference is actually -7.105427357601e-15 and the compare fails. In your program the == should be changed to >= so when countdown is equal to or greater than 10 then you add 1 to y.