class FlyableAttackUnit(AttackUnit, Flyable):
def __init__(self, name, hp, damage, flying_speed):
AttackUnit.__init__(self, name, hp, 0, damage) # 지상 speed 0처리
Flyable.__init__(self, flying_speed)
def move(self, location):
print("[공중 유닛 이동]")
self.fly(self.name, location)
# pass를 설정하게 되면 코드가 완성되지 않아도 완성된 것 처럼 오류없이 실행되게 된다.
# 건물
class BuildingUnit(Unit):
def __init__(self, name, hp, location):
pass
# 서플라이 디폿 : 건물, 1개 건물 = 8 유닛.
supply_depot = BuildingUnit("서플라이 디폿", 500, "7시")
def game_start():
print("[알림] 새로운 게임을 시작합니다.")
def game_over():
pass
game_start()
game_over()
'Python' 카테고리의 다른 글
Python-class (스타크래프트 예시) (0) | 2020.07.05 |
---|---|
Python-super (0) | 2020.07.05 |
Python-메소드 오버라이딩 (0) | 2020.07.05 |
Python-다중상속 (0) | 2020.07.05 |
Python-상속 (0) | 2020.07.05 |