클래스.py
·
python
## 클래스 # 공격 함수 def attack(name, location, damage): print("{}:{} 방향으로 적군을 공격합니다. [공격력{}]"\\ .format(name, location, damage)) # class : 붕어빵 기계로 많이 묘사된다. class unit: # __init__ : python 에서 쓰이는 생성자, 객채가 생성될때 자동으로 호출되는 부분 # __init__ 은 특정 초기상태로 커스터마이즈된 인스턴스 객체로 생각하면 된다. # class로부터 만들어지는 요소들을 객체라고 표현함. def __init__(self,name, hp, damage) : self.name = name self.hp = hp self.damage = damage print("{}유닛이..