How do I make a click able object with counter?

Get help using Construct 2

Post » Wed Apr 30, 2014 2:02 am

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 :D
B
47
S
14
G
20
Posts: 87
Reputation: 12,913

Post » Wed Apr 30, 2014 3:40 am

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 :D

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.
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Wed Apr 30, 2014 7:06 am

Sargas wrote: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 :D

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 :D
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. ;)

Image
You do not have the required permissions to view the files attached to this post.
B
47
S
14
G
20
Posts: 87
Reputation: 12,913

Post » Wed Apr 30, 2014 12:13 pm

I added some comments to it too.
You do not have the required permissions to view the files attached to this post.
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Wed Apr 30, 2014 10:18 pm

Sargas wrote: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 :D 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 8-) .

Big big thanks.......
B
47
S
14
G
20
Posts: 87
Reputation: 12,913

Post » Wed Apr 30, 2014 11:49 pm

@LaroTaio you're welcome :D

did you read the begginers tutorials?
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Thu May 01, 2014 12:37 am

Message: LaroTaio is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Sargas wrote:@LaroTaio you're welcome :D

did you read the ?
Yes Master :mrgreen: I'll keep reading it again and again, so much stuff to learn :geek: ........
B
47
S
14
G
20
Posts: 87
Reputation: 12,913


Return to How do I....?

Who is online

Users browsing this forum: Anna Nehves Br, divsyntax, volumetv and 16 guests