Having a Image Sprite recognize different background colors

I have a student that is creating a game where a random color generates at the bottom of the game and the user has a limited amount of time to move a ball within the canvas on top of that color based on the background image. If the user does this in time, they should receive a point.

The problem is that I can't help my student figure out how to have the ball recognize that it is on the correct color of the background image to give the user a point. Here is the file:

Color_Run.aia (44.9 KB)

I am new to teaching with App Inventor so I'm limited in knowledge on how to help my student. Any help you can offer will be greatly appreciated.


Create a Button1 to check color.

Read here about X Y in Ball component.

Thank you. Any suggestions on the event that can be used to have the user receive a point when the ball is placed over the correct color before the time runs out?

Your student might start here Programming Your App to Make Decisions

and Drawing and Animation components

He/she needs a variable to handle points; myPoints = myPoints + 1
and learn to use the Clock * [Clock] https://community.appinventor.mit.edu/search?q=count%20down%20timer
(http://ai2.appinventor.mit.edu/reference/components/sensors.html#Clock) to make a count down timer.

If the student posts the code tried, someone will provide specific advice.


Below is a link to the original code.

Color_Run.aia (44.9 KB)

You might post the Blocks. Glad to look at them and provide advice.

Here is a detailed discussion about how to recognize different background colors Button placement(How to use Canvas screen colors to create a Q&A Quiz

Your game is almost over. The only thing missing was calling the color check routine. I invoked this routine after clicking the buttons. I also added a variable that will block adding multiple points in one field.
Color_Run (1).aia (46.2 KB)

Thank you! I think my student has it working now! Have a great weekend!