MIT APP Inventor background color change

im having trouble trying to change the background color of my timer when it reaches 10 seconds. if anyone can help me it'll be helpful!!!

You changed the "...TextColor" to red instead of the "...BackgroundColor"

1 Like

I noticed I did that and when I change it to background color it still doesn't change the color when it reaches 10 seconds. it only changes it when it goes to 0.

That is because you have it set up like that.

Change timer to 15

1 Like

will it still work if I change it to 15? my timer has to start from 25 and go down to 0 and when it hits 10 the background color of the timer is supposed to change.

It will countdown by 15 then start counting down by 10 (and your text/background colour will change at 10).

15 + 10 = 25 << is this the total countdown time you want ?

2 Likes

that doesn't work, when I change my timer to 15 it starts at 15. I need it to start at 25 and change color at 10. this is what I have but its still not working.

Try like this

1 Like

its not working, it goes to 24 then it stops counting down. is there a way to program it without a button because my app doesn't need a button.

You need to take these three items out of the clock timer event

image

The blocks as I showed above count down from 25 to 0 (for me) then the clock stops. if you want it to keep counting down into the minus then remove the else socket and clock stop block

1 Like

Hm, this works.

Alternative if a continuous run is wanted (funny task)

Funny.aia (3.3 KB)

1 Like

thank you I finally figured it out but now im having trouble with this... I must have a single button to start and stop the game (which I called it the game button in my program)

  • When the game is not being played (as in when the player first opens the game, hits the stop button, or runs out of time, the button text should display START

  • When the game is in play, the button text should display the word STOP

  • Whenever the game ends, the player will be notified of the final score and the button will show the text START to allow the player to play a new game.

  • The time begins counting down when the user clicks on the START button
    • The game ends (time automatically goes to 0) when the user clicks on the STOP
    button (this is the same button as above), or when the countdown reaches 0 seconds.

So, what would you say to my first game inspired by yours? It might help you to give your game a more detailed and speaking structure. Write speaking procedures that only overtake one task. Then it will be easier to analyze it and one wouldn't loose the overview. You could extend the functions - adding a scoring part, adding your gaming routines and so on. As I said, I don't have any experience in writing games but this could work as a basic template, I think. Of course, my game_ACTION will be your colliding scene...

game (1).aia (4.2 KB)