Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python making player equipment

#  declare equipment as a dictionary
player_equip_dict = {
	"Helmet": "",
    "Right Hand": "",
    "Left Hand": "",
    "Chest": "",
    "Back": "",
    "Legs": "",
    "Feet": "",
}

#  assign an item to equipment
player_equip_dict.update({"Right Hand": "sword"})

#  remove an item from equipment
player_equip_dict.update({"Right Hand": ""})
 
PREVIOUS NEXT
Tagged: #python #making #player #equipment
ADD COMMENT
Topic
Name
3+6 =