I need help (whit Counters)

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hello people of "Clickteam" community
    First for all, my native languaje is Spanish, sorry for the traslate!
    About 3 weeks ago I start learning programming in ctf 2.5, and I'm very happy with this Software.

    I need help and I explain below.

    I am creating a game platform "sidescroller". I want to do that when pressed (1 time) a key (Q for example). Every 1 second, a counter of 10, one point is subtracted. And when that happens (only when this happen), things like "power ups" occur (that`s not the problem).

    I would like to do something like a "switch", where pressing once "Q" is activated and deactivated. And If the "Swhitch" is enabled, subtract 1 point and if its turning off rejoining until 10 ...
    I hope you understand me, I speak Spanish and use google Traslate.

    Thank you!

    PD: As far as I could, I did that when Q is pressed, the counter becomes visible and there subtracts 1 from the counter, but I see that is not the best way, it is difficult, and i want to see always the counter in the screen.

  • Hello DillonKun and welcome

    I'm not sure I got exactly what you need,
    but if you need to "switch" between two situations,
    the quickest and cleanest way is probably "toggling" a flag

    Like:

    upon pressing Q
    >>> (object*) toggle internal flag "xx" (a number of your choice)

    (object) internal flag "xx" ON
    >>> do the subtract thing from counter

    (object) internal flag "xx" OFF
    >>> do the rejoin thing to counter


    * choose an active object always present in the frame, like your player
    or prepare a new object to use specifically for these means
    (you'll probably find his values and flag useful for other tasks too)

    a selection of my Fusion examples can be found Please login to see this link.

  • In this example, "Counter 2" would be your "Counter of 10"
    You'll have to insert another counter, and in this example that counter is called "Counter".


    Upon pressing Q *INSERT* "Counter" = 0 *INSERT* Timer is greater than 0:
    - Set timer = 0
    - Set "Counter" = 1

    Upon pressing Q *INSERT* "Counter" = 1 *INSERT* Timer is greater than 0:
    - Set timer = 0
    - Set "Counter" = 0

    "Counter" = 0 *INSERT* Every 1 second
    - Subtract 1 from "Counter 2"

    "Counter" = 1 *INSERT* Every 1 second
    - Add 1 to "Counter 2"


    Hope this method is simple enough, and useful. :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!