Help understanding a formula in OSTime Demo
I'm looking at the OSTime demo. In the LED clock the minutes digit has the following formula:
Constrain Attribute, Self Image to:
( game.Clock.Minute %10)..".png"
Can someone tell me what the %10 and ..".png" is doing?
Constrain Attribute, Self Image to:
( game.Clock.Minute %10)..".png"
Can someone tell me what the %10 and ..".png" is doing?
Comments
Here is a good tutorial on it
Need Help? Email Me | Templates | Full Game Source Code
The % is called the Modulo Operator. It just gives you the remainder of a division.
It has been suggested by GS staff to use the mod(x,y) operator -- they're trying to set a programming standard, so that if any major changes affecting the equation editor takes place your old games won't break.
Also I think there's no need to add the file extension when directing the name of images in Gamesalad (correct me if I'm wrong).