示例#1
0
    void NewGame()
    {
        // Assign values
        laserchance          = 0.7f;
        Enemy.enemyMoveSpeed = 2;
        scoreboard.text      = "Score: " + 0;
        extraLife            = 0;

        // Create/Start a new level
        NewLevel();

        // Do not display the leaderboard
        gameoverScript.Display(false);

        // Player starts with 3 lives
        lives          = 3;
        liveCount.text = "Lives Left: " + 3;

        // Create an instance of player
        Instantiate(this.Player, new Vector3(0, -9, 0), Quaternion.AngleAxis(180, Vector3.up));
        healthbar.text = "Health: " + p2.health;

        // Create the 4 instances of blocks
        this.GenerateBlocks(-10f, -7.5f);
        this.GenerateBlocks(8f, -7.5f);
        this.GenerateBlocks(-5f, -7.5f);
        this.GenerateBlocks(3f, -7.5f);
    }
示例#2
0
    void NewGame()
    {
        // Assign values
        laserchance          = 0.7f;
        Enemy.enemyMoveSpeed = 2;
        scoreboard.text      = "Score: " + 0;
        extraLife            = 0;

        // Create/Start a new level
        NewLevel();

        // Do not display the leaderboard
        gameoverScript.Display(false);

        // Player starts with 3 lives
        lives          = 3;
        liveCount.text = "Lives Left: " + 3;
    }