# Player Classes

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2FFrwI5Qjr6RWF5DaWSixR%2FExplore%2010_30_2023%2012_03_13%20PM.png?alt=media&#x26;token=884d1cd5-f718-4f6d-a64a-9c9ddc9d4ee8" alt=""><figcaption></figcaption></figure>

## **How it works:**

I reconstructed FrmLevel to initially show a class selection menu with icons showing the classes and buttons that select which class you will be.\
\
Once the buttons are pressed the appropriate health and strength is altered for the player.

## For the Tank:

```csharp
    private void ClassTankButton_Click(object sender, EventArgs e)
    {
        player.MaxHealth = 50;
        player.Health = 50;
        player._strength = 1;
        this.Controls.Remove(ClassTankButton);
        this.Controls.Remove(ClassFighterButton);
        this.Controls.Remove(ClassAssassinButton);
        this.Controls.Remove(ClassMenuBackground);
        this.Controls.Remove(ChooseClassLabel);
        this.Controls.Remove(picPlayer);
        this.Controls.Remove(picAssassin);
        this.Controls.Remove(DisplayClassFighter);
        this.picPlayer = picTank;
    }
```

* Set maxHealth and Health to 50
* Set player's strength to 1
* Remove the class menu
* Assigns the player's icon to the tank icon

## For the Fighter:

```csharp
   private void ClassFighterButton_Click(object sender, EventArgs e)
   {
       player.MaxHealth = 20;
       player.Health = 20;
       player._strength = 2;
       this.Controls.Remove(ClassTankButton);
       this.Controls.Remove(ClassFighterButton);
       this.Controls.Remove(ClassAssassinButton);
       this.Controls.Remove(ClassMenuBackground);
       this.Controls.Remove(ChooseClassLabel);
       this.Controls.Remove(picTank);
       this.Controls.Remove(picAssassin);
       this.Controls.Remove(DisplayClassFighter);
   }
```

* Set maxHealth and Health to 20
* Set player's strength to 2
* Remove the class menu
* No need to assign the player's icon as it is set to fighter icon by default

## For the Assassin:

```csharp
    private void ClassAssassinButton_Click(object sender, EventArgs e)
    {
        player.MaxHealth = 15;
        player.Health = 15;
        player._strength = 3;
        this.Controls.Remove(ClassTankButton);
        this.Controls.Remove(ClassFighterButton);
        this.Controls.Remove(ClassAssassinButton);
        this.Controls.Remove(ClassMenuBackground);
        this.Controls.Remove(ChooseClassLabel);
        this.Controls.Remove(picPlayer);
        this.Controls.Remove(picTank);
        this.Controls.Remove(DisplayClassFighter);
        this.picPlayer = picAssassin;
    }
```

* Set maxHealth and Health to 15
* Set player's strength to 3
* Remove the class menu
* Assigns the player's icon to the assassin icon
