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:
Last updated