예제 #1
0
        private void RenderForm_Load(object sender, EventArgs e)
        {
            InitRender();

            timer1.Start();
            coneSpawnTimer.Start();

            DoubleBuffered = true;

            View.InitSlips();
            World.OnCreation();
            World.StartNewGame();
        }
예제 #2
0
        private static void LoadSave()
        {
            var save =
                JsonSerializer.Deserialize <GameSave>(File.ReadAllText("save.json"));

            StartNewGame();
            GameObjectsPool.Clear();
            GameObjectsPool.AddRange(save.cans);
            GameObjectsPool.AddRange(save.cars);
            GameObjectsPool.AddRange(save.cones);

            Stats.CansEatten = save.cansEatten;
            creationTime     = save.creation;

            View.InitSlips(new Bitmap(Image.FromFile("slips.bmp")));
        }
예제 #3
0
 public static void StartNewGame()
 {
     Stats.maxCanEaten = (int)Math.Max(Stats.CansEatten, Stats.maxCanEaten);
     View.InitSlips();
     InitWorld();
 }