7. Shield

The Shield class is used to create defensive shields. Instances of the Shield class is used in correlation with the Player.equipshield. When equipping the shield, the vars Player.shield and Player.shield_protect get populated with information based on the parameters when creating an instance of Shield . When the shield is equipped, the player takes reduced damage from attacks.

When creating an instance, two parameters are required:

  • name

    • The name of the shield

  • defense

    • The amount of damage removed when being attacked.

An instance can be created like this:

super_shield = TARBSengine.Shield("Super Shield", 7)
# A shield with the name "Super Shield" that reduces the enemies attack by 7 damage

Last updated