1. Open Your project

First, open the project in your preferred editor. This tutorial uses VS Code.

image.png

image.png

2. Declare Variables

A variable is like a special box with a name that we can store things inside.

Think of it like this: Imagine your parents told you to clean your room. You put all your toys in a box labeled toys and said: “This box is only for toys.”

Now, whenever you want your toys, you grab the toys box, not the shoes box or the gardening box.

Variables in code work the same way. We make a CustomArmor box called:

myHelmet.

We’ll use this variable to store our custom armor data. Whenever we want this armor data, we just use myHelmet.

image.png

3. Initialize Variables

When we initialize a variable, we are storing information inside of our variable. So similar to our toy box, now that we have labeled our toy box, we can now store toys inside it. But in regard to our myHelmet, we can now store custom helmet data inside of our custom armor variable.

image.png

3. Create CustomArmor.java

Now currently our code references no existing class to create our custom armor so we need to create a CustomArmor class.

image.png