I’m having trouble figuring out how to add a score to my game in Thunkable X. For example, changing the number of coins you get when you press yes or no on an alert. Can someone please help me?
When click yes button (was confirmed block)set the from coins get text + 1.then set it’s variable with stored.
Something like this
https://x.thunkable.com/projects/5d7ad1a1a3f63268b468d81f/7d3e2ce3-7a2c-4f9e-aa33-6a65ca53fac6/blocks
Thank you so much, you’re a life-saver!
hello…can anyone help me with adding score of player 1 and player 2
here is the link
https://x.thunkable.com/copy/893bfc1089bfe0e30d0ed2fb680024d4
When you post a question, especially if it includes a link to a project, please explain the problem you are having and where we might look (which screen, which label or other component, which blocks) to find it.
So I am building an app called dice war in this app there are two players (Player1,Player2).
The First Chance is of player1,So the player1 should click on Check The Dice Number when he clicks it the app shows the dice number which = player1 Score, So just like this the player2 also plays next it will be again player1 turn zo when he clicks on the button the app shows the dice number , now the app should add the Scores but I don’t know the codes for that.
SORRY for the not explaining properly here is the link now
https://x.thunkable.com/copy/9c653aff7d4cbaebddfcd46e86d8023b
It would be good if you could explain what a few rounds look like. For example:
Player 1 rolls 3
Player 1’s score = 3
Player 2 rolls 5
Player 2’s score = 5
Player 1 rolls 6
Player 1’s score = 9
Player 2 rolls 1
Player 2’s score = 6
Is that how it’s supposed to work?
yep
Then you need to add some addition (+) blocks in order to add the number that was rolled to the current player’s total.
can u tell me the codes
Have a look in the math drawer. You’ll find the blocks you need for adding values together.
ok …should I create a variable as Score then
should I add the variables number and Score = Player1 Score
Sounds good!
Is it correct ?
I said it sounds good but you should try it to make sure it works for you.
ok
Is it the way I told
That’s going to take the number that was rolled and add it to the score and then save that value as the number variable. I don’t think that’s what you want!
To translate what you wrote, you would have blocks that say:
Number + Player 1 Score = Player 1 Score
But since Thunkable works left to right, your blocks should be:
Set Player 1 Score to Player 1 Score + Number
You’re also going to need separate variables for each player’s score (Player 1 Score and Player 2 Score).