Skip to content

Commit

Permalink
Merge pull request #92 from EntelectChallenge/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
DaanKeun authored Jun 4, 2018
2 parents 9282e81 + 5462381 commit bed0583
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 15 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,39 @@ Improvements and enhancements will be made to the game engine code over time. T

The game engine has been made available to the community for peer review and bug fixes, so if you find any bugs or have any concerns, please [e-mail us]([email protected]) or discuss it with us on the [Challenge forum](http://forum.entelect.co.za/), alternatively submit a pull request on Github and we will review it.

## Bot upload archive structure

Your archive should contain at least a bot.json with your source code in the **root** of the archive.

```
{bot-archive-name}.zip
|--- bot.json
|--- {source_code}
```

For example the Java sample bot should look like:
```
|--- bot.json
|--- src
|--- main
|--- {package_directories}
|--- Bot.java
|--- Main.java
|--- entities
|--- Building.java
|--- BuildingStats.java
|--- Cell.java
|--- CellStateContainer.java
|--- GameDetails.java
|--- GameState.java
|--- Missle.java
|--- Player.java
|--- enum
|--- BuildingType.java
|--- Direction.java
|--- PlayerType.java
```

## Interim replay viewer

If you guys are looking to view your bot's shenanigans in a more visual way, we have a nice little viewer built by someone from the forum that will let you do just that.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,23 @@ private void calculateMissileMovement() {
.forEach(missile ->
IntStream.rangeClosed(1, missile.getSpeed()) // higher speed bullets
.forEach(i -> {
towerDefenseGameMap.moveMissileSingleSpace(missile);
towerDefenseGameMap.getBuildings().stream()
.filter(b -> b.isConstructed()
&& positionMatch(missile, b)
&& !b.isPlayers(missile.getPlayerType())
&& b.getHealth() > 0)
.forEach(b -> {
TowerDefensePlayer missileOwner = null;
try {
missileOwner = towerDefenseGameMap.getPlayer(missile.getPlayerType());
} catch (Exception e) {
log.error(e);
}
b.damageSelf(missile, missileOwner);
});
if (missile.getSpeed() > 0) {
towerDefenseGameMap.moveMissileSingleSpace(missile);
towerDefenseGameMap.getBuildings().stream()
.filter(b -> b.isConstructed()
&& positionMatch(missile, b)
&& !b.isPlayers(missile.getPlayerType())
&& b.getHealth() > 0)
.forEach(b -> {
TowerDefensePlayer missileOwner = null;
try {
missileOwner = towerDefenseGameMap.getPlayer(missile.getPlayerType());
} catch (Exception e) {
log.error(e);
}
b.damageSelf(missile, missileOwner);
});
}
})
);
}
Expand Down

0 comments on commit bed0583

Please sign in to comment.