Added test map for capture points and some debug code.
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Player/>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:AABB/>
|
||||
<c:CapturePoint/>
|
||||
<c:Team/>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
@@ -0,0 +1,149 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/DummyScene.obj</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Health>
|
||||
<Health>60</Health>
|
||||
</c:Health>
|
||||
<c:AABB/>
|
||||
<c:Camera/>
|
||||
<c:Listener/>
|
||||
<c:Player/>
|
||||
<c:Team>
|
||||
<Team>3</Team>
|
||||
</c:Team>
|
||||
<c:Transform>
|
||||
<Position X="-0.151326105" Y="13.5594187" Z="12.5957394"/>
|
||||
<Orientation X="-0.733037829" Y="0.157069013" Z="5.6575832e-08"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:AABB/>
|
||||
<c:CapturePoint/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
|
||||
<Color A="1" B="1" G="0.200000003" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
<Team>3</Team>
|
||||
</c:Team>
|
||||
<c:Transform>
|
||||
<Position X="5.48757935" Y="2.62824345" Z="0"/>
|
||||
</c:Transform>
|
||||
<c:Trigger/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:AABB/>
|
||||
<c:CapturePoint>
|
||||
<CapturePointNumber>1</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
|
||||
<Color A="1" B="0" G="0.200000003" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team/>
|
||||
<c:Transform>
|
||||
<Position X="1.91470337" Y="2.32191443" Z="0"/>
|
||||
</c:Transform>
|
||||
<c:Trigger/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:AABB/>
|
||||
<c:CapturePoint>
|
||||
<CapturePointNumber>2</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
|
||||
<Color A="1" B="0" G="0.200000003" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team/>
|
||||
<c:Transform>
|
||||
<Position X="-1.31178355" Y="2.16289616" Z="0"/>
|
||||
</c:Transform>
|
||||
<c:Trigger/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:AABB/>
|
||||
<c:CapturePoint>
|
||||
<CapturePointNumber>3</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
|
||||
<Color A="1" B="0" G="0.200000003" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
<Team>2</Team>
|
||||
</c:Team>
|
||||
<c:Transform>
|
||||
<Position X="-4.27947044" Y="1.99913001" Z="0"/>
|
||||
</c:Transform>
|
||||
<c:Trigger/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
|
||||
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
<c:Team>
|
||||
<Team>2</Team>
|
||||
</c:Team>
|
||||
<c:Transform>
|
||||
<Position X="-5.74354839" Y="2.23822045" Z="-0.0577065349"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
|
||||
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
<c:Team>
|
||||
<Team>3</Team>
|
||||
</c:Team>
|
||||
<c:Transform>
|
||||
<Position X="6.96941662" Y="2.02053547" Z="-0.0348547697"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
@@ -60,7 +60,13 @@ void CapturePointSystem::UpdateComponent(World* world, EntityWrapper& entity, Co
|
||||
}
|
||||
|
||||
int ownedBy = teamComponent["Team"];
|
||||
|
||||
//Probably want to distinguish the capturepoint depending on team affiliation.
|
||||
if (entity.HasComponent("Model")) {
|
||||
//Now sets team color to the capturepoint, or white if it is uncaptured.
|
||||
entity["Model"]["Color"] = ownedBy == blueTeam ? glm::vec4(0, 0.2f, 1, 1) :
|
||||
ownedBy == redTeam ? glm::vec4(1, 0.2f, 0, 1) :
|
||||
glm::vec4(1, 1, 1, 1);
|
||||
}
|
||||
//om ej next satt, förvänta sig att en capturepoint med en viss team färg kommer in...
|
||||
//sätt isåfall next och kör på..
|
||||
//gör inget tills man fått den infon
|
||||
@@ -109,6 +115,9 @@ void CapturePointSystem::UpdateComponent(World* world, EntityWrapper& entity, Co
|
||||
//B. at most one of the teams have players inside (this means datavariable currentTeam is not 0)
|
||||
//if capturePoint is not owned by the take-over team, just modify the CaptureTimer accordingly
|
||||
if (ownedBy != currentTeam) {
|
||||
if (abs((double)capturePoint["CaptureTimer"]) < 0.001f) {
|
||||
LOG_DEBUG("Point is being captured by team %i", currentTeam); //Remove when we tested sufficiently.
|
||||
}
|
||||
capturePoint["CaptureTimer"] = (double)capturePoint["CaptureTimer"] + timerDeltaChange;
|
||||
}
|
||||
//if capturePoint is owned by the team, and the other team has been trying to take it, then increase/decrease the timer towards 0.0
|
||||
@@ -121,6 +130,7 @@ void CapturePointSystem::UpdateComponent(World* world, EntityWrapper& entity, Co
|
||||
teamComponent["Team"] = currentTeam;
|
||||
capturePoint["CaptureTimer"] = 0.0;
|
||||
//publish Captured event
|
||||
LOG_DEBUG("Point is captured by team %i!", currentTeam); //Remove when we tested sufficiently.
|
||||
Events::Captured e;
|
||||
e.CapturePointID = capturePoint.EntityID;
|
||||
e.TeamNumberThatCapturedCapturePoint = currentTeam;
|
||||
|
||||
Reference in New Issue
Block a user