private void RenderForm_Load(object sender, EventArgs e) { InitRender(); timer1.Start(); coneSpawnTimer.Start(); DoubleBuffered = true; View.InitSlips(); World.OnCreation(); World.StartNewGame(); }
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"))); }
public static void StartNewGame() { Stats.maxCanEaten = (int)Math.Max(Stats.CansEatten, Stats.maxCanEaten); View.InitSlips(); InitWorld(); }