Why is my code stuck in a looping sequence and not triggering events?

In my code, as shown above, there is what would essentially be a 'true' loop for most of the game. However, as soon as this loop is activated, the jump button doesn't work anymore, and neither does the edge reached. I would have thought that event handling would still allow each of these events to work seperately.

Why is my code stuck in a looping sequence and not triggering events?

Because you created an endless loop, which results in your app becoming unresponsive
Your variable status always is 0

Taifun

But howthen would you get the rest of the app to be responsive? I need the loop to make my obstacles move, yet still require everything else to work.

It's completely unclear to me what your blocks are supposed to do. Explain in more detail...
Also show all relevant blocks (and post a simple test aia).

The basic design should be a Clock Timer that services lists of planned events, one per cycle.

1 Like

Instead of using a while loop, use a Clock timer, with TimerAlwaysFires set to true.

Do you mind explaining how I would do this?

See this example

https://appinventor.mit.edu/explore/ai2/molemash.html

A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

1 Like

Here are some sample apps to study:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.