Problem with timer in my Tower Defense

Get help using Construct 2

Post » Sun Mar 10, 2013 1:30 pm

I am new to this forum, so I'd like to say hello to everyone.
I'm also new to C2 and I'm just developing my first game with friend. Here is my problem: When I click on text "Ready" I want timer to appear below. I mean something like "Wave will start in: 3.. 2.. 1"
I've tried Every X Second condition but it subtracts only once and then stopps and I have to click again to subtract again and it's like I press Ready, it goes from 3 to 2 and then I have to press ready again and it goes from 2 to 1.. I hope you know what I mean, it's hard to explain with my english. I just want it to go by 3, 2, 1 after 1 click.

To be sure you understand, here is the .capx
https://www.dropbox.com/s/iirgrhb4rjyi19c/TowerDefense.capx
Thanks!Meloo2013-03-10 13:31:53
B
11
S
1
Posts: 76
Reputation: 1,664

Post » Sun Mar 10, 2013 3:30 pm

Try this: TowerDefenseX
ImageImage
B
66
S
19
G
121
Posts: 3,195
Reputation: 72,852

Post » Sun Mar 10, 2013 4:41 pm

The link isn't working for me, getting some random letters and numbers. (or there is a way to download/save it but I don't know how, sorry)
B
11
S
1
Posts: 76
Reputation: 1,664

Post » Sun Mar 10, 2013 4:44 pm

Right-click & Save link as...
ImageImage
B
66
S
19
G
121
Posts: 3,195
Reputation: 72,852

Post » Sun Mar 10, 2013 5:00 pm

Also, don't forget that you need to test if "Defender.Floating is not true" before assigning targets to the turrets. Otherwise they can fire before they're actually placed down.
B
56
S
15
G
10
Posts: 910
Reputation: 11,942

Post » Sun Mar 10, 2013 5:06 pm

Hi Meloo, I just had a brief look at your capx. I could find the Every 1.0 Second event that triggers the substraction on the "Timer"-Variable, but I could not find the action where you write that new value on the screen. Maybe you want to add a "Set ToStart-Text to 3-Timer"-Action to the "Every 1.0 Second"-Event, right after the Timer-Variable-Update!?
B
6
Posts: 33
Reputation: 816

Post » Sun Mar 10, 2013 6:04 pm

[QUOTE=blackhornet] Try this: http://bht.hostingsiteforfree.com/samples/TowerDefenseX.capx[/QUOTE]

Thank you blackhornet! It requires some tweaking though (pressing ready during the wave still starts the counting and I got no idea how to repair it but I will be trying!) but there is a one question I got. What is "dt" and how does it work? (You used it in subtracting) I've read it's delta time or something but still can't figure it out.

Also thanks for other replies guys! You are very helpful and I hope our game will be released soon for you to play :)
B
11
S
1
Posts: 76
Reputation: 1,664

Post » Sun Mar 10, 2013 6:16 pm

DT is how long it's been since the last tick. If you add them up, you'll get (ideally) 60 a second, so you can use this as a timer counter.
ImageImage
B
66
S
19
G
121
Posts: 3,195
Reputation: 72,852


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests