Need a little help

Get help using Construct 2

Post » Fri Nov 11, 2011 2:34 pm

I have created my second game and am having a little trouble with the countodown timer.

I have it working but, when it reaches zero I want to game to stop and the timer to stop.

I have inputted what i thought would work but it doesnt, could someone take a look at the file and see where i may be going wrong

http://dl.dropbox.com/u/22753176/Shooting%20-%20Copy.capx

Many thanks in advanceLprez2011-11-11 14:42:46
B
4
G
2
Posts: 30
Reputation: 1,260

Post » Fri Nov 11, 2011 2:56 pm

you should do this

when timeleft > 0 | substract from timeleft

when timeleft < 0 or = go to level1 (end game)

vtrix2011-11-11 14:57:24
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Fri Nov 11, 2011 3:13 pm

Hi Vtrix

thanks for the reply

I am not overly sure what you mean

I have added the action subtract ...from time left (what number should i put in there)

andreally not sure what you mean by go to level 1.

sorry for being a noob, not long been using this software
B
4
G
2
Posts: 30
Reputation: 1,260

Post » Fri Nov 11, 2011 3:18 pm

yeah im sorry, i was too fast,

to restart or go to another level use the "system" "go to layout"

also only substract from timeleft when its bigger then 0

then normally it would be sufficient to use if timeleft = 0

but for safety i used if timeleft is = or smaller then 0

sometimes you can come in a situation where you substracted under 0

so using <= is safer then =

vtrix2011-11-11 15:22:19
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Fri Nov 11, 2011 3:31 pm

In your system group instead of system TimeLeft = 0 use system TimeLeft <=0
And as action instead of wait 999 seconds, system go to layout 2 for a debrief there for example.

If you want to "pause" the spawning of animals, etc once the timer is at 0, create a global variable (example "GameState" as a text. When the game is on set it to "InGame", when the time is over set it to "TimeUp").
You'll have to add a condition to the spawning of animals to check the value of this global variable.

Example for "Sheep Spawn", event 11 add to system every 10 seconds another condition (right click "Add another condition") system GameState = "InGame".

When TimeLeft is <= 0 set GameState to "TimeUp", this should prevent animals from spawning.
You can also add the condition in the group shooter to prevent the movement of the shotgun and more shot to be fired.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Fri Nov 11, 2011 3:50 pm

Brilliant, the spawning stopped, thx for that.

I cannot seem to get the timer to stop at zero though

System - timeleft < = 0
Acton: system - subtract 0 from timeleft

that is what i have, does this seem correct
B
4
G
2
Posts: 30
Reputation: 1,260

Post » Fri Nov 11, 2011 4:28 pm

Ah loved the sheeps lol
B
18
S
4
G
5
Posts: 149
Reputation: 4,498

Post » Fri Nov 11, 2011 4:56 pm

no its when timeleft bigger then (>) 0 substract 1 from timeleft

now you have when timeleft is smaller then or equel then 0
substract 0 from timeleft,   doesnt makes any sense :)vtrix2011-11-11 17:00:55
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Mon Nov 14, 2011 12:03 pm

Hi again guys

stoill experiencing an issue with this countdown timer.

I have:

system time left > 0 ---- subtract 1 from timeleft

the time just flies down from 30 to zero.

if i add the following

system every 1 second ------ subtract 1 from timeleft     it does the same.

how do i have the countdown coming down from 30 to zero correctly.

I seem to be going both ways here, eithet it flies down real fast or counts down then goes past zero.

I must be missing soemthing here that is plain for all to see.
B
4
G
2
Posts: 30
Reputation: 1,260

Post » Mon Nov 14, 2011 12:13 pm

hmm should work, can you show a capx?
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Next

Return to How do I....?

Who is online

Users browsing this forum: Televangelist and 29 guests