Способ разрешить функцию щелчка во время циклаJAVA

Программисты JAVA общаются здесь
Ответить
Гость
 Способ разрешить функцию щелчка во время цикла

Сообщение Гость »


I'm making an app for my high school computer science class, and I wanted to do a recreation of flappy bird in code.org using their simplified java interface. I decided to use a loop that constantly drops the turtle and moves it to the right until it hits the x coordinate on the right of the screen, which sends it to the left side. I then tried using an onEvent that would raise it up when the user clicks the screen, but I realized that while the loop is running the onEvent is unable to work at the same time. Is this possible to resolve with code.org's limited version of Java? In what way would this be done in full-access java?

I tried setting the onEvent inside the loop, which obviously didn't work. My teacher suggested to just do something easier, but I'm hoping someone on here can help me figure this out :)


Источник: https://stackoverflow.com/questions/781 ... ing-a-loop
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»