-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Got capturing flags working
- Loading branch information
Asser
authored and
Asser
committed
Jun 16, 2017
1 parent
e2c41e7
commit c727db2
Showing
53 changed files
with
2,920 additions
and
2,395 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
#Sat May 27 14:47:45 CEST 2017 | ||
#Fri Jun 16 22:33:54 CEST 2017 |
Binary file modified
BIN
+0 Bytes
(100%)
sim-eth-es/.gradle/2.13/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Material BombMaterial : MatDefs/AnimateSpriteShader.j3md { | ||
MaterialParameters { | ||
AniTexMap : Flip Textures/Subspace/flag.bm2 | ||
numTilesX : 10 | ||
numTilesY : 2 | ||
Speed : 20 | ||
numTilesOffsetX : 0 | ||
numTilesOffsetY : 0 | ||
} | ||
AdditionalRenderState { | ||
Blend Alpha | ||
Wireframe Off | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package example.es; | ||
|
||
import com.simsilica.es.EntityComponent; | ||
|
||
/** | ||
* | ||
* @author Asser | ||
*/ | ||
public class Flag implements EntityComponent{ | ||
|
||
public Flag() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
sim-eth-es/src/main/java/example/es/states/FlagStateServer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package example.es.states; | ||
|
||
import com.simsilica.es.Entity; | ||
import com.simsilica.es.EntityData; | ||
import com.simsilica.es.EntityId; | ||
import com.simsilica.es.EntitySet; | ||
import com.simsilica.sim.AbstractGameSystem; | ||
import com.simsilica.sim.SimTime; | ||
import example.es.Flag; | ||
import example.es.Frequency; | ||
import org.dyn4j.collision.manifold.Manifold; | ||
import org.dyn4j.dynamics.BodyFixture; | ||
|
||
/** | ||
* | ||
* @author Asser | ||
*/ | ||
public class FlagStateServer extends AbstractGameSystem { | ||
|
||
private EntityData ed; | ||
private EntitySet teamFlags; | ||
private ShipFrequencyStateServer shipState; | ||
|
||
@Override | ||
protected void initialize() { | ||
this.ed = getSystem(EntityData.class); | ||
|
||
teamFlags = ed.getEntities(Flag.class, Frequency.class); | ||
|
||
shipState = getSystem(ShipFrequencyStateServer.class); | ||
} | ||
|
||
@Override | ||
protected void terminate() { | ||
teamFlags.release(); | ||
teamFlags = null; | ||
|
||
} | ||
|
||
public boolean isFlag(EntityId flagEntityId){ | ||
return teamFlags.getEntityIds().contains(flagEntityId); | ||
} | ||
|
||
@Override | ||
public void update(SimTime tpf) { | ||
teamFlags.applyChanges(); | ||
} | ||
|
||
@Override | ||
public void start() { | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
} | ||
|
||
public void collide(org.dyn4j.dynamics.Body body1, BodyFixture fixture1, org.dyn4j.dynamics.Body body2, BodyFixture fixture2, Manifold manifold, double tpf) { | ||
EntityId one = (EntityId) body1.getUserData(); | ||
EntityId two = (EntityId) body2.getUserData(); | ||
|
||
if (teamFlags.getEntityIds().contains(one)) { | ||
int freq = shipState.getFrequency(two); | ||
ed.setComponent(one, new Frequency(freq)); | ||
} else if (teamFlags.getEntityIds().contains(two)) { | ||
int freq = shipState.getFrequency(one); | ||
ed.setComponent(two, new Frequency(freq)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.