I am making a reaction based Android game, containing multiple levels.
In level 1 I want an ImageView to change from red to green at quick random intervals, the user is to click the ImageView when it is green to score points.
I am using a separate class to run an AsyncTask, to randomly change the background colour of the ImageView at random times. The code is contained in a while loop, which is checking for levelPoints to reach 50 (These points go up depending on the OnClick event in level1 class).
Here's the issue - The colour of the background changes once and does not change during the while loop. I have used Log.v to find out the state of the random number and level points, which seem to show that the loop is working fine.
The project is WIP, but I thought this section should be at a stage where I can test it working by ending the loop by clicking on green 50 times. Not the case.
Any help is appreciated as to why the colour does not change during the while loop. I have searched StackOverflow and other sites/forums for similar issue and cannot find any of similar nature.
Here is the link to the files in question on GitHub
Aucun commentaire:
Enregistrer un commentaire