实时战略游戏:从单人战役到多人对战的技术实现
1. 单人战役最终关卡搭建
在实时战略(RTS)游戏的单人战役中,最终关卡“Under Siege”是最具挑战性的。玩家需不断建造单位,抵御多波敌人攻击,保护载有难民的运输车辆,直至殖民地援军到来。
以下是创建该关卡的代码:
{
"name":"Under Siege",
"briefing": "Thanks to the attack led by you, we now have control of the rebel base. We can expect the rebels to try to retaliate.\n The colony is sending in aircraft to help us evacuate back to the main camp. All we need to do is hang tight until the choppers get here. \n Luckily, we have some supplies and ammunition to defend ourselves with until they get here. \n Protect the transports at all costs.",
/* Map Details */
"mapImage":"images/maps/level-one.png",
"startX":0,
"startY":20,
/* Map coordinates that are obstructed