A defence map is three things: spawn enemies on a period, send them toward a goal, and count the ones that arrive. The timer and spawn lessons carry over unchanged.
Trigger { -- 생성된 적을 계속 목표 지점으로 보낸다
players = {P8},
conditions = {
Deaths(P8, AtLeast, 24, "OrderTimer");
},
actions = {
SetDeaths(P8, SetTo, 0, "OrderTimer");
Order("Men", P8, "Track", Move, "Goal");
PreserveTrigger();
},
}Leak handling is the heart of it: when an enemy enters the goal, remove it and take a life.
Trigger {
players = {P8},
conditions = {
Bring(P8, AtLeast, 1, "Men", "Goal");
},
actions = {
RemoveUnitAt(All, "Men", "Goal", P8);
SetDeaths(P8, Subtract, 1, "Lives");
DisplayText("\x13\x06적이 통과했습니다");
PreserveTrigger();
},
}
Trigger { -- 생명이 다 떨어지면 패배
players = {Force1},
conditions = {
Deaths(P8, Exactly, 0, "Lives");
},
actions = {
DisplayText("\x13\x06방어에 실패했습니다");
Defeat();
},
}If each player defends their own lane rather than a shared one, keep lives on CurrentPlayer and eliminate only the player who runs out. Win conditions are covered in a later lesson.
