Example #1
0
        static int Main(string[] args)
        {
            Application app  = new Application("New Pillar Game");
            Time        time = new Time();

            GlobalPersistantUpdate = time.Frame;
            RoutineRunner runner = new RoutineRunner();
            Level         main   = new Level("main");

            while (!exit)
            {
                Input.Poll();
                if (!GlobalPause)
                {
                    GlobalUpdate?.Invoke();
                }
                GlobalPersistantUpdate();
                if (ThreadManager.Frame())
                {
                    Thread.Sleep(1);
                }

                Console.Write($"\r{Time.SampleCount}: {1f/Time.SmoothDeltaTime}       ");
                if (Input.GetKeyDown(Key.Up))
                {
                    Time.SampleCount += 100;
                }
            }
            return(0);
        }
Example #2
0
 public static void AddTimer(float duration, Action callback) => RoutineRunner.RunRoutine(RunTimer(duration, callback));
Example #3
0
 private void FrameCoroutines() => RoutineRunner.FrameSubset(attachedCoroutines);
Example #4
0
 public static void AddTimer(int frames, Action callback) => RoutineRunner.RunRoutine(RunTimer(frames, callback));