/// <summary>
    /// Initialisiert alles und startet das Spiel
    /// </summary>
    /// <param name="spielmodus">Beschreibt welcher Spielmodus gespielt werden soll</param>
    public void Start(Spielmodus spielmodus)
    {
        this.spielmodus = spielmodus;
        timer.Start();
        superman   = new Superman(gr, new Size(GAME_WIDTH, GAME_HEIGHT));
        stars      = new Stars(gr, new Size(GAME_WIDTH, GAME_HEIGHT));
        kryptonite = new Kryptonite(gr, new Size(GAME_WIDTH, GAME_HEIGHT));
        powerups   = new Powerups(gr, new Size(GAME_WIDTH, GAME_HEIGHT));

        if (this.spielmodus == Spielmodus.Normal)
        {
            // Normalmodus etwas schneller machen damit es nicht zu langweilig wird
            this.speed = 3;
        }
        else if (this.spielmodus == Spielmodus.Endlos)
        {
            this.speed = 3;
        }
        else if (this.spielmodus == Spielmodus.Hardcore)
        {
            this.speed = 6;
        }

        stars.SpawnStars(this.speed, spielmodus);
        kryptonite.SpawnKryptonite(this.speed, this.level, this.spielmodus);
        powerups.SpawnPowerup();

        Draw();
    }
Example #2
0
        public static InfluxData ToInfluxData(Kryptonite kryptoniteDetails, List <Where> whereList, DateTimeOffset timestamp)
        {
            string where = whereList.Where(w => w.WhereId == kryptoniteDetails.WhereId).Single().Name.Replace(" ", "-");

            var fields = InfluxKeyValueHelper.GetInfluxKeyValuesFromPoco(kryptoniteDetails);

            return(new InfluxData
            {
                Measurement = "nest_remote",
                Timestamp = timestamp,
                Tags = new Dictionary <string, string> {
                    { "location", where }
                },
                Fields = fields
            });
        }