Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First fully functional and fun release #49

Merged
merged 91 commits into from
Jun 15, 2020
Merged
Changes from 1 commit
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
d59b4b7
Delete InventoryItemButton class and move its contents to InventoryBu…
8ru73u5 Jun 8, 2020
1f6f1d8
Change ImageButton to Button for InventoryButton and add padding to t…
8ru73u5 Jun 8, 2020
2ca4c98
Merge pull request #25 from APRO-Project/feature/inventory-buttons-re…
RouNNdeL Jun 9, 2020
e55856a
Player damaging takes armor into account
RouNNdeL Jun 9, 2020
646a4f5
Improve player death handling with a separate interface method
RouNNdeL Jun 9, 2020
f9c0c83
Make player death event consistent
RouNNdeL Jun 9, 2020
b7426ea
Finish the session when all players have died
RouNNdeL Jun 9, 2020
52ef3a6
Rework entity removal, fix multiple dispose calls on one Entity
RouNNdeL Jun 9, 2020
67de6df
Merge pull request #27 from APRO-Project/feature/player-death
RouNNdeL Jun 10, 2020
ecb6675
Allow the RefilingItemStack to not be affected by modifiers (default …
RouNNdeL Jun 10, 2020
ab15968
Add medium bomb
RouNNdeL Jun 10, 2020
69cd185
Add missing texture (wrong for now) for medium bomb
RouNNdeL Jun 11, 2020
f05a4ed
Improve code, balance upgrade max count
RouNNdeL Jun 11, 2020
002813d
Merge pull request #28 from APRO-Project/feature/item-improvements
RouNNdeL Jun 11, 2020
724ad2f
Add getters for upgrades and usable items in Inventory
8ru73u5 Jun 12, 2020
01b64cd
Add getter for collectible texture regions and rename class as it no …
8ru73u5 Jun 12, 2020
8951f95
Add static to health related constants
8ru73u5 Jun 12, 2020
01a30a7
Get texture regions from GraphicsFactory
8ru73u5 Jun 12, 2020
2b37b19
Change double curly braces map definition to Map.of()
8ru73u5 Jun 12, 2020
715db3c
Merge pull request #29 from APRO-Project/feature/inventory-view-impro…
8ru73u5 Jun 12, 2020
25218d9
Code cleanup
BWalusiak Jun 13, 2020
ffc274c
Improve documentation
RouNNdeL Jun 13, 2020
33f0405
Use the ANIMATION_SPEED constant in the CollectibleSprite animation
RouNNdeL Jun 13, 2020
602c5de
Further improve documentation
RouNNdeL Jun 13, 2020
afcbce9
Remove unused code, fix crash in LWC
RouNNdeL Jun 13, 2020
7bc176b
Merge pull request #30 from APRO-Project/misc/code-improvements
RouNNdeL Jun 13, 2020
2169384
Change raw arrays to ArrayLists
8ru73u5 Jun 13, 2020
1446297
Add important fixme
8ru73u5 Jun 13, 2020
d1ac58f
Merge branch 'development' into feature/end-screen
BWalusiak Jun 13, 2020
48f377f
Merge pull request #31 from APRO-Project/fix/generic-arraus-crap
8ru73u5 Jun 13, 2020
53bf1b3
Add jar build task, few bug minor fixes
RouNNdeL Jun 13, 2020
f2609de
Merge pull request #32 from APRO-Project/feature/end-screen
RouNNdeL Jun 13, 2020
4a0a64a
Merge pull request #33 from APRO-Project/feature/jar
RouNNdeL Jun 13, 2020
b240159
Fix file loading in JAR
BWalusiak Jun 13, 2020
f6d8a59
Fix world simulation locks
8ru73u5 Jun 14, 2020
2d62b27
Merge pull request #34 from APRO-Project/fix/world-sim
8ru73u5 Jun 14, 2020
06ecdaa
Add player "animations"
8ru73u5 Jun 14, 2020
9ea587d
Add local player texture to local player view
8ru73u5 Jun 14, 2020
b2c86ca
Add bomb explosion animation
8ru73u5 Jun 14, 2020
22bf22d
Merge pull request #35 from APRO-Project/feature/player-quote-animati…
8ru73u5 Jun 14, 2020
02b90e8
Merge pull request #36 from APRO-Project/feature/end-screen
BWalusiak Jun 14, 2020
c24880c
Add leaderboard game end
RouNNdeL Jun 14, 2020
2b6b28b
Fix local and remote player deaths
RouNNdeL Jun 14, 2020
fd504a0
Add missing textures, add nuke
BWalusiak Jun 14, 2020
bffcb0e
Add end screen
BWalusiak Jun 14, 2020
8fbcad6
Merge branch 'development' into feature/end-screen
BWalusiak Jun 14, 2020
ccfb040
Display end screen on game end event
BWalusiak Jun 14, 2020
1818136
Remove bomb player texture variant field
BWalusiak Jun 14, 2020
77b7fcd
Remove the rest of texture variant field
BWalusiak Jun 14, 2020
898bf00
Merge pull request #37 from APRO-Project/feature/end-screen
BWalusiak Jun 14, 2020
ecebcef
Remove null pointer exception
8ru73u5 Jun 14, 2020
8ed7792
Merge pull request #38 from APRO-Project/fix/player-list-view-improve…
8ru73u5 Jun 14, 2020
a77623e
Fix GameStateController's entity removal
RouNNdeL Jun 14, 2020
adabd67
Make spawn random, balance collectibles
RouNNdeL Jun 14, 2020
43cfc51
Change to beta, change lobby length to 4
RouNNdeL Jun 14, 2020
86eba64
Improve leaderboard layout
RouNNdeL Jun 14, 2020
9bd32e2
Disable collision between players
RouNNdeL Jun 14, 2020
c9bf920
Add random nick generation
RouNNdeL Jun 14, 2020
4506a7d
Merge pull request #39 from APRO-Project/misc/minor-fixes-improvements
RouNNdeL Jun 14, 2020
4b33503
Add boom
BWalusiak Jun 14, 2020
ad6d5ce
Tweak player speed
RouNNdeL Jun 14, 2020
96f7458
Merge pull request #40 from APRO-Project/feature/boom-texture
BWalusiak Jun 14, 2020
68a0c44
Rearrange code in PlayerEntity
RouNNdeL Jun 14, 2020
88e3a73
More balancing
RouNNdeL Jun 14, 2020
576f7a2
Change entity draw order
RouNNdeL Jun 14, 2020
01ee6c4
Merge pull request #41 from APRO-Project/misc/game-balance
RouNNdeL Jun 14, 2020
93c4a62
Add .--. .. . .-. -.. --- .-.. --- -. . / -.- ..- .-. .-- .- / --. --…
8ru73u5 Jun 14, 2020
f323f42
Add freezer type
8ru73u5 Jun 14, 2020
5d81798
Add freezer texture
BWalusiak Jun 14, 2020
63babdd
Fix not disappearing explosions
RouNNdeL Jun 14, 2020
ee06808
Rework damage handling using the ExplosionEntity
RouNNdeL Jun 14, 2020
bc36bd5
Merge pull request #42 from APRO-Project/feature/explosion-animation
RouNNdeL Jun 14, 2020
df00f46
Fix dead player removal
RouNNdeL Jun 14, 2020
d374455
Minor UI improvements
BWalusiak Jun 14, 2020
1b9a32b
Integrate freezer with the game and tweak some of its properties
8ru73u5 Jun 14, 2020
876c25c
Add frozen tint to whole map when local player gets frozen
8ru73u5 Jun 14, 2020
ccb53d7
Merge pull request #43 from APRO-Project/feature/enter-accept
BWalusiak Jun 14, 2020
b6effcd
Texture update
BWalusiak Jun 14, 2020
ba332b7
Merge pull request #44 from APRO-Project/feature/fryzjer
8ru73u5 Jun 14, 2020
71af18f
Texture update
BWalusiak Jun 15, 2020
0b351c9
Merge pull request #45 from APRO-Project/feature/textures
BWalusiak Jun 15, 2020
ff8261b
Remove casual item stack from inventory and inventory view when it ru…
8ru73u5 Jun 15, 2020
603f016
Merge pull request #46 from APRO-Project/feature/empty-stack-hud-removal
8ru73u5 Jun 15, 2020
0aefe83
Add insta boom upgrade type
8ru73u5 Jun 15, 2020
097d871
Integrate insta boom with the game
8ru73u5 Jun 15, 2020
6543b17
Add icon and title
BWalusiak Jun 15, 2020
030b5e8
Lower explosion shape dimensions
8ru73u5 Jun 15, 2020
f45ff2e
Change version to 1.0.0-release
8ru73u5 Jun 15, 2020
8204b12
Merge pull request #47 from APRO-Project/feature/insta-boom
8ru73u5 Jun 15, 2020
704bd32
Swap switch item controls
8ru73u5 Jun 15, 2020
32c7204
Merge pull request #48 from APRO-Project/fix/key-binds-change
8ru73u5 Jun 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Player damaging takes armor into account
  • Loading branch information
RouNNdeL committed Jun 9, 2020
commit e55856a1a08dbc0f47d1bd02b8950a0ba3018025
1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -199,13 +199,13 @@ private void onBombExploded(BombEntity bomb) {

TileMapLayer walls = map.getWalls();

damagePlayers(x, y, (int) (bombPower * 2));
damagePlayers(x, y, (bombPower * 2));

// Right
for (int i = 1; i <= range; i++) {
Tile tile = walls.getTile(x + i, y);

damagePlayers(x + i, y, (int) powerRight);
damagePlayers(x + i, y, powerRight);
powerRight = damageTile(tile, powerRight);
powerRight = Math.max(0, powerRight - bomb.getPowerDropoff());

@@ -218,7 +218,7 @@ private void onBombExploded(BombEntity bomb) {
for (int i = 1; i <= range; i++) {
Tile tile = walls.getTile(x - i, y);

damagePlayers(x - i, y, (int) powerLeft);
damagePlayers(x - i, y, powerLeft);
powerLeft = damageTile(tile, powerLeft);
powerLeft = Math.max(0, powerLeft - bomb.getPowerDropoff());

@@ -231,7 +231,7 @@ private void onBombExploded(BombEntity bomb) {
for (int i = 1; i <= range; i++) {
Tile tile = walls.getTile(x, y + i);

damagePlayers(x, y + i, (int) powerUp);
damagePlayers(x, y + i, powerUp);
powerUp = damageTile(tile, powerUp);
powerUp = Math.max(0, powerUp - bomb.getPowerDropoff());

@@ -244,7 +244,7 @@ private void onBombExploded(BombEntity bomb) {
for (int i = 1; i <= range; i++) {
Tile tile = walls.getTile(x, y - i);

damagePlayers(x, y - i, (int) powerDown);
damagePlayers(x, y - i, powerDown);
powerDown = damageTile(tile, powerDown);
powerDown = Math.max(0, powerDown - bomb.getPowerDropoff());

@@ -254,13 +254,14 @@ private void onBombExploded(BombEntity bomb) {
}
}

private void damagePlayers(int x, int y, int power) {
private void damagePlayers(int x, int y, float power) {
players.stream().filter(playerEntity ->
{
Vector2 playerPosition = playerEntity.getPosition();
return (Math.floor(playerPosition.x) == x && Math.floor(playerPosition.y) == y);
}
).forEach(playerEntity -> playerEntity.subtractHp(power));
).forEach(playerEntity -> playerEntity.takeDamage(power));

players.stream().filter(PlayerEntity::isDead).forEach(playerEntity -> {
playerEntity.markToRemove();
playerEntity.dispose();
Original file line number Diff line number Diff line change
@@ -52,8 +52,8 @@ public void addHp(int value) {
hp = Math.min(100, hp + value);
}

public void subtractHp(int value) {
hp = Math.max(0, hp - value);
public void takeDamage(float power) {
hp = (int) (Math.max(0, hp - power) * inventory.getArmorMultiplier());
}

public PlayerEntity(World world, PlayerDef def, long id) {
Original file line number Diff line number Diff line change
@@ -6,5 +6,5 @@
public class Upgrade {
public static final float MOVEMENT_SPEED_MULTIPLIER = 1.1f;
public static final float REFILL_SPEED_MULTIPLIER = 1.1f;
public static final float ARMOR_MULTIPLIER = 1.1f;
public static final float ARMOR_MULTIPLIER = 0.85f;
}
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ public final class Constants {
/**
* How many times per second a snapshot is sent over the network.
*/
public static final int TICK_RATE = 20;
public static final int TICK_RATE = 60;

public static final int LOBBY_ID_LENGTH = 5;
}
12 changes: 0 additions & 12 deletions core/src/main/java/com/cyberbot/bomberman/core/utils/Utils.java
Original file line number Diff line number Diff line change
@@ -38,18 +38,6 @@ public static Object fromByteArray(byte[] buf, int offset, int length) {
return null;
}

public static boolean isSequenceNext(int sequence, int previous) {
return isSequenceNext(sequence, previous, Integer.MAX_VALUE / 100);
}

public static boolean isSequenceNext(int sequence, int previous, int maxDrop) {
if (Math.abs(sequence - previous) < maxDrop) {
return sequence >= previous;
} else {
return sequence <= previous;
}
}

public static String generateLobbyId(int length) {
return RandomStringUtils.randomNumeric(length);
}
Original file line number Diff line number Diff line change
@@ -49,10 +49,10 @@ class ServerService(
override fun onPacket(payload: ControlPacket, service: ClientControlService) {
when (payload) {
is ClientRegisterRequest -> onClientRegister(payload, service)
is LobbyCreateRequest -> onLobbyCreate(payload, service)
is LobbyCreateRequest -> onLobbyCreate(service)
is LobbyJoinRequest -> onLobbyJoin(payload, service)
is LobbyLeaveRequest -> onLobbyLeave(service)
is GameStartRequest -> onGameStart(payload, service)
is GameStartRequest -> onGameStart(service)
else -> logger.error { "Unsupported packet type ${payload.javaClass.simpleName}" }
}
}
@@ -94,7 +94,7 @@ class ServerService(
}
}

private fun onLobbyCreate(request: LobbyCreateRequest, service: ClientControlService) {
private fun onLobbyCreate(service: ClientControlService) {
service.apply {
if (lobbies.size < maxLobbyCount) {
val lobby = createLobby(client!!)
@@ -137,7 +137,7 @@ class ServerService(
removeClientFromLobby(service.client)
}

private fun onGameStart(request: GameStartRequest, service: ClientControlService) {
private fun onGameStart(service: ClientControlService) {
val lobby = lobbies.values.firstOrNull { it.ownerId == service.client!!.id } ?: return
val lobbyId = lobby.id ?: throw RuntimeException("Lobby in lobbies without id")