2020-02-16 05:24:10 +00:00
|
|
|
/*The ~/Registry.CC file is CosmiC code.
|
2021-07-02 06:04:42 +01:00
|
|
|
You can execute a tree branch of it. The System
|
2021-07-02 00:53:42 +01:00
|
|
|
branch is executed in the System task boot phase.
|
2020-02-15 20:01:48 +00:00
|
|
|
Normally, you will place var declarations
|
|
|
|
in the branch you make, but since an arthmetic expression
|
2020-02-16 05:24:10 +00:00
|
|
|
is valid in CosmiC you can place simple expressions
|
2020-02-15 20:01:48 +00:00
|
|
|
without vars.
|
|
|
|
*/
|
|
|
|
|
2020-12-23 23:27:18 +00:00
|
|
|
RegDefault("DemoCompany/Game1", "F64 best_score=1.23;\n");
|
|
|
|
RegDefault("DemoCompany/Game1/SimpleVal", "1234;\n");
|
2020-02-15 20:01:48 +00:00
|
|
|
RegExe("DemoCompany/Game1");
|
|
|
|
|
|
|
|
U0 Game()
|
|
|
|
{
|
2020-12-23 23:27:18 +00:00
|
|
|
I64 i = RegExe("DemoCompany/Game1/SimpleVal");
|
|
|
|
|
|
|
|
"High Score:%6.5f\n", best_score;
|
|
|
|
"Val:%d\n", i;
|
2020-02-20 23:40:10 +00:00
|
|
|
i++;
|
2020-12-23 23:27:18 +00:00
|
|
|
best_score = tS;
|
2020-02-15 20:01:48 +00:00
|
|
|
//You could combine these into one write by making
|
2020-02-20 23:40:10 +00:00
|
|
|
//the $$TR...$$ and $$ID,2$$, $$ID,-2$$, cmds yourself.
|
2020-12-23 23:27:18 +00:00
|
|
|
RegWrite("DemoCompany/Game1", "F64 best_score=%9.5f;\n", best_score);
|
|
|
|
RegWrite("DemoCompany/Game1/SimpleVal", "%d;\n", i);
|
2020-02-15 20:01:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Game;
|