Skip to content

Commit e04bbc7

Browse files
committed
Scheduler System.md
1 parent cf8da14 commit e04bbc7

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

Examples/Save System.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ public class Program : GameLoop
1414
// for every object you want to save
1515
// its best to nest save objects to not create ALOT of files
1616
Gb.RegisterSaveItem(obj, "file name");
17-
18-
// to load:
19-
Gb.LoadItems();
20-
21-
// to save:
22-
Gb.SaveItem();
2317
}
2418

2519
public override void UpdateLoop()
@@ -32,7 +26,18 @@ public class Program : GameLoop
3226
}
3327
```
3428

35-
adding encryption is very easy to ad
29+
to save/load items do:
30+
make sure to execute AFTER the save items are registered in the init
31+
32+
```c#
33+
// load
34+
Gb.LoadItems();
35+
36+
// save
37+
Gb.SaveItem();
38+
```
39+
40+
adding encryption is very easy to add
3641
you should put this before the init of gamebox if you want to set
3742
the encryption
3843

Examples/Scheduler System.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
the scheduler system is a very powerful system
2+
3+
schedulers are for timing events
4+
5+
it is very easy to add a scheduler, however you should use low ms times with caution
6+
7+
```c#
8+
GameBox.Gb.AddScheduler(new Scheduler(timeInMsToRepeat, onTime: () => {
9+
// what you want to happpen when it repeats
10+
}, setTime: true by default
11+
/*if set time is false then the scheduler will execute the onTime event on Init*/))
12+
```
13+
14+
the reason you should caution about low timeInMsToRepeat times is because it might not be fast enough to hit it again
15+
16+
it is recommended to go above 50

0 commit comments

Comments
 (0)