About Every Tick

0 favourites
  • 8 posts
  • Hi, i have a question regarding Every Tick.

    I have read in the "How events work" section that: "Every event is checked once per tick (about 60 times a second on most computers), and they are run from top to bottom in the event sheet.

    Before and after, i read it, i was using "Every Tick" this way:

    [attachment=0:2wpazy44][/attachment:2wpazy44]

    I think that to compare two values or make collision happens, i need the every tick, for what i understand, its not need it right?

    But in cases that i need to display score, or something like that, it is useful the "Every Tick"

    I dont fully understand the purpose of Every Tick after reading the how events work, can someone help me to understand, i know its an easy question, sorry.

  • It can get quite confusing, the logic in your head is right.

    The point is that events in Construct (conditions) already are checked everytick, so you don't need to add that block (it's already hidden in there).

    An example of usage for everytick would be moving a sprite do the right, you can use

    On Every Tick > Sprite set X to Sprite.X+1

    this way the sprite will move 1 pixel to the right every frame.

  • Tx Caio caiorosisca for the reply! I really appreciate. I have another question now that i have that concept more clear.

    its the same to say:

    On Every Tick > Sprite set X to Sprite.X+1

    to:

    If 0 = 0 > Sprite set X to Sprite.X+1

    I mean, the events are checked everytick by default, if i make a condition always true, its the same as saying "On every tick" ?

    cheers!

  • every event condition is considered every tick, hence 1+2 is functionally equivalent to 3 in your diagram, irrespective of your subsequenct use of the event trigger. I don't see why collisions or score displays would change this.

    you should be able to test this very easily by writing the code to display something.. perhaps incrementing text in two text boxes, one driven by each event structure.

    I would ask why you need to update the score every 15 milliseconds though? personally I update scores perhaps 1 per second, or 5 times per second, or on an action. it just keeps the load on the system down.

    PS: to your second question, yes that would move the sprite one pixel every tick.. just remember that ticks are not precisely regular so if you are depending on them... they could change if the game logic gets busier. if would be better imho to stick with every XX seconds... instead.

  • The 'every tick' event is just a dummy/placeholder to remind you that it is executed every tick. You need this where you don't have another event/condition on which to hang your actions. You can just as well leave it completely blank. Or, have a 'dummy' condition as you described, but that might look silly (but that's subjective).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • tx rho!,

    I would ask why you need to update the score every 15 milliseconds though? > Actually im not, but im trying to learn from some capx i donwloaded from the site, and those are questions that i have looking at the events sheet, tryiing to understand how are they making things happend!

    Cheers, and tx for the replys!

  • This is covered in Common mis-used events and gotchas

  • Tx, i will read it

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