# How do I change number of balls text if player misses

0 favourites
• 3 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
• Hey all. Say I have a basketball game where the player has to shoot the basketballs into the net in order to score and there is text of 3 shown in upper left hand corner. How can I make it so that if the player misses the basketball net with the ball, the 3 shown will change to 2 indicating the player has 2 more balls left....then if he misses another basketball shot the 2 text will change to a 1 shown and then if he misses the next shot, the 1 will change to 0. Could someone please post a capx illustrating this?

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• please post a capx illustrating this?

Share a basic capx, with the basic setup, and i will add to it.

• Hey all. Say I have a basketball game where the player has to shoot the basketballs into the net in order to score and there is text of 3 shown in upper left hand corner. How can I make it so that if the player misses the basketball net with the ball, the 3 shown will change to 2 indicating the player has 2 more balls left....then if he misses another basketball shot the 2 text will change to a 1 shown and then if he misses the next shot, the 1 will change to 0. Could someone please post a capx illustrating this?

1-Create a global variable representing the number of balls you have (3 in this case) and name it BALLS

2-Set a local variable to the ball and set it to 1 if it goes in,

3.a- if it does not go in, of course you leave it to 0...

3.b-if the ball hits the ground or falls beyond a certain "Y" value and its variable is =0, than you remove 1 to the global variable BALLS.

After that, set the text to "balls left"&BALLS...

• 3 posts