How do I change number of balls text if player misses

0 favourites
  • 3 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • 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?

  • please post a capx illustrating this?

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)