How do I make a variable decrease even when the project isn't open

helpwithcode

#21

Sorry for language. lol


#22

It’s just basically divide but the output is the remainder


#23

Modulo is very helpful when making buttons with options that cycle.

This website helped me a lot
https://www.khanacademy.org/computing/computer-science/cryptography/modarithmetic/a/what-is-modular-arithmetic


#24

A ok :+1:


#25

Ok let me test something… I’m coming back dwbh


#26

Ok I’ll be back as well


#27

WOW. too hard for me, guess I’ll just make it work just when game is open


#28

You’d need a way to save variables then. You can’t do that, so it won’t work anyway.


#29

Yeah, you’re right, it won’t work anyways


#30

COAN’s project also stops when app is exited, but you can do this:

  1. Use “Detect a Close” code to detect a close
  2. Calculate and Recalculate timestamp (have a pause/load screen when exit)
  3. Use the difference to subtract health

#31

The WaitTilTimestamp block can be accessed in a JSON file draft. JSON File draft also includes a delete clone method.


#32

This is really hard. Things like “cloud variables” (like you can find in Scratch) would really help. You could try to implement some kind of system with “save codes”, which I have already done in a project. Here is the one that I’m talking about:


My approach makes it pretty easy to figure out how to hack the game though.


#33

Great site, thanx for recommending it