Need a little help

0 favourites
  • 13 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • 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 advance

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you should do this

    when timeleft > 0 | substract from timeleft

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

  • 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

  • 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 =

  • 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.

  • 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

  • Ah loved the sheeps lol

  • 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 :)

  • 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.

  • hmm should work, can you show a capx?

  • Hey Vtrix

    dl.dropbox.com/u/22753176/Shooting2.capx

    I have removed one of the system tasks, i now only have the:

    system - every 1 second -------------subtract 1 from timeleft.

    try adding the other action in and see what happens.

    many thanks for your time on this, i have been pulling my hair out.

  • add a is system timeleft not equel to 0

    add this to the every 1 second substract 1 from timeleft

    this wil make when 0 reached it will not count anymore! yey,

    love killing that sheeps!

    what about something you cant shoot, like a man with deerhat :)

  • superb, thanks for that...see so simple if you know how. i will look at adding such a fellow.

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