Just a simple setable clock

hi there

i need help for a simple clock like this:

25:00 (in Min:Sec Format in this Example)

but it shouldn´t be connected with the current time a.s.o.
I´d like to set the clock with a down/up Arrow in 5 sconds steps.

At the moment i got 2 variables Var_Min and Var_Sec and when the Var_Sec is greater than 59, set Var_Sec to 00 and add 1 to Var_Min… i can´t imagine that this is the best way to do it…

it works indeed, but if i want to calculate 2 clocks in one for example, smoke coming out of my ears…

55:14 + 00:56 = 56:10 you know what i mean?

How can i calculate it?
thanks for help

Hi,
You need to calculate like real time, if varsec>60, add 1 to varmin and remove 60 to varsec. :slight_smile:

Yes… this is what i did (and explained above), but what i need is a kind of automation of this, something like variable = (mm:ss) or similiar.

If its not possible, and the only way to do is in a varsec and varmin expression, so how can i calculate 2 clocks in a third one?
Example: clock1 22:14 + clock2 14:50 = clock3 35:04 (and not clock3 34:64)

Add the two clocks to the third one, and the calculation is the same as explained above :thinking:
I don’t understand the issue.

Ok i think i know what you mean: 3 clocks so i ned 6 var’s

Varsec1 + varsec2 (into varsec3) same with minunte

Is varsec3 60 than add 1 to varmin3 and sub 60 from varsec3 aso

My mistake was to count varsec1+varsec2 and set the result into a txt

Ah ok, yes, you need two variables for each clock :slight_smile:

Ok…
But nevertheless, it would be great if there was a pre-installed “clock format” to use in gdevelop :nerd_face:
Thanks so far✌

1 Like

Hi again

So… to calculate 2 clocks in 00:00 format is a really hard work, but to multiplicate them with another value, seems to be impossible!

When my App is ready, i show you what i mean…

Nevertheless, i found a formating tool in gdevelop 5 under funktions/behaivor = TimeFormatting.

This tool do all the work what i explained i want it to do :star_struck:

now i got another issue, it´s off topic indeed, but it is just a little question: is there a function to prevent sleep on mobiles?

Thanks so far :+1:

Cool, I didn’t know about it :slight_smile:
Perhaps a javascrîpt trick to prevent sleep… like this: https://phpnews.io/feeditem/have-a-web-page-prevent-your-screen-computer-from-dimming-sleeping-with-the-wake-lock-api

Ok thanks… could you give me a hint how or where i has to integrade javacodes?

It’s in the big plus.
specialevent

Ok i’ll try it thanks👍

it seems to be more difficult as i thought

I found 3 different codes for “WakeLock”, every one of these let freeze the game.

i fond a open topic about this issue here in the forum, but the explianed way to implent this code is not mind blowing, it is mind crushing!

Before Gdevelop, i used Clickteam Fusion.
I prefer Gdevelop, its smarter in my eyes , but in Clickteam you got a simple and easy extension, where you can chek the command “start slep prevention” thats it…
Hope Gdevelop will offer such an extension soon

Hope you manage to make it and share it with everyone :smile:

Got it :blush:

1 Like