How do I make a click able object with counter?

0 favourites
  • 7 posts
From the Asset Store
Make a displayed number gradually increase or decrease, making an impression of a real-time counting.
  • How do I make an object after clicking will have a counter showing over it, then it shows or replace another click able object becoming active after the counting has finished, once clicked will go to the designated layout?

    Thanks in advance

  • Let me see if I understood what you want:

    1) click an object.

    2) that objects shows a countdown (like, 3...2....1...)

    3) when the countdown is finished, another object appears (i'm guessing some sort of "confirmation" pop-up)

    4) when you click that second object, you change layout.

    if that's the case, then it's super easy

    1)Create your "button"; could be a sprite, a text or a button object. and create a variable called "countdown" on it, and set it to 4.

    2)With the mouse or touch object use the condition "on object clicked/touched" (that object has to be your button) ---> set it to 3.

    3)Then on another event make this: When object.coundown =or< 3, every 1 seconds, as long as it's greater than 0 ----> object: substract 1 from countdown.

    4)And when object.countdown = 0; make the second object appear by setting it's position to where you want it to be. (originally have it placed outside the layout,)

    5) and when that object is touched/clicked -----> go to desired layout.

    In order to display a text over the first object, there are several ways; you could make the object with 5 sprites and set frame to timer. or you could place a text over it and set that text to object.timer.

    Also, I really recommend you go trough the beginners tutorials as this is really basic and you should have learned it there. Then read the manual at least once, so in the future you know what to look for when in doubt.

  • Let me see if I understood what you want:

    1) click an object.

    2) that objects shows a countdown (like, 3...2....1...)

    3) when the countdown is finished, another object appears (i'm guessing some sort of "confirmation" pop-up)

    4) when you click that second object, you change layout.

    if that's the case, then it's super easy

    1)Create your "button"; could be a sprite, a text or a button object. and create a variable called "countdown" on it, and set it to 4.

    2)With the mouse or touch object use the condition "on object clicked/touched" (that object has to be your button) ---> set it to 3.

    3)Then on another event make this: When object.coundown =or< 3, every 1 seconds, as long as it's greater than 0 ----> object: substract 1 from countdown.

    4)And when object.countdown = 0; make the second object appear by setting it's position to where you want it to be. (originally have it placed outside the layout,)

    5) and when that object is touched/clicked -----> go to desired layout.

    In order to display a text over the first object, there are several ways; you could make the object with 5 sprites and set frame to timer. or you could place a text over it and set that text to object.timer.

    Also, I really recommend you go trough the beginners tutorials as this is really basic and you should have learned it there. Then read the manual at least once, so in the future you know what to look for when in doubt.

    I really messed the code up LOL

    I've been over the manual 4 times already, seems like its gonna take me more time to become familiar with C2.

    I can easily learn thru example, getting tid bits of tricks from this forum and YT Tuts. But there are just so many things you must learn for non programmers like me. Sometimes I'm thinking if C2 is a really easy to learn game engine creator as its claiming, I'm having doubts if I will ever create an original full working game. But with C2 masters like you hanging around patiently and willing to help, hopes are high that I will be able to complete my game project.

  • I added some comments to it too.

  • I added some comments to it too.

    Incredible! Dude you really know your stuff. I couldn’t have figure this out myself even with written example, but with a working sample capx, I can easily grasp the idea, especially with your comments explanation On the coding event,I never knew that you can have more than 2 conditions, that alone is new to me, I'm also having problem with animation frame on where I will put it in, usually on the action, but I never thought that you can also put it on the condition. A very educating stuff bratha. Very much appreciated your extra effort showing me your awesome talent.

    Indeed you really are a C2 Master .

    Big big thanks.......

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • LaroTaio you're welcome

    did you read the begginers tutorials?

  • LaroTaio you're welcome

    did you read the ?

    Yes Master ........

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