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
Remove unused code, fix crash in LWC
  • Loading branch information
RouNNdeL committed Jun 13, 2020
commit afcbce9b4a2b6444f27055786204a594c48fdc3c
2 changes: 1 addition & 1 deletion .idea/misc.xml

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

2 changes: 1 addition & 1 deletion client/core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: "java"
apply plugin: 'org.jetbrains.kotlin.jvm'

sourceCompatibility = 1.8
sourceCompatibility = 13
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

sourceSets.main.java.srcDirs = [ "src/" ]
17 changes: 5 additions & 12 deletions client/core/src/com/cyberbot/bomberman/Client.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
package com.cyberbot.bomberman;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.cyberbot.bomberman.controllers.ScreenController;

public class Client extends Game {

public static final float V_WIDTH = 100;
public static final float V_HEIGHT = 100;

private ScreenController gsm;
private ScreenController screenController;

@Override
public void create() {
final float w = Gdx.graphics.getWidth();
final float h = Gdx.graphics.getHeight();

gsm = new ScreenController(this);
screenController = new ScreenController(this);
}

public ScreenController getGsm() {
return gsm;
@Override
public void dispose() {
// TODO: Dispose everything using the ScreenController
}
}
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

import com.badlogic.gdx.Input;

@SuppressWarnings("CanBeFinal")
public class KeyBinds {
public int up = Input.Keys.W;
public int down = Input.Keys.S;
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ public final class PlayerListView extends Table {
private static final int MAX_PLAYERS = 3;

public PlayerListView(Skin skin) {
// FIXME: Use something better than arrays - immutable list from apache commons or guava
players = new ImmutablePair[MAX_PLAYERS];
labels = new ImmutablePair[MAX_PLAYERS];

Original file line number Diff line number Diff line change
@@ -134,8 +134,8 @@ public void clicked(InputEvent event, float x, float y) {
ui.add(lobbyId).width(tableWidth).height(playerLabelHeight).row();
}

public void addPlayer(String playername, int number) {
playerLabels[number].setText(playername);
public void addPlayer(String playerName, int number) {
playerLabels[number].setText(playerName);
}

public void removePlayer(int number) {
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ public class LoginScreen extends AbstractScreen {
private final SpriteBatch batch;
private final Viewport viewport;

LoginLayout loginLayout;
private final LoginLayout loginLayout;

public LoginScreen(LoginInteraction delegate) {
batch = new SpriteBatch();
Original file line number Diff line number Diff line change
@@ -16,8 +16,7 @@ public class MenuScreen extends AbstractScreen {
private final SpriteBatch batch;
private final Viewport viewport;


MenuOptions menuOptions;
private final MenuOptions menuOptions;

public MenuScreen(MenuInteraction delegate) {
batch = new SpriteBatch();
2 changes: 1 addition & 1 deletion client/desktop/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: "java"

sourceCompatibility = 1.8
sourceCompatibility = 13
sourceSets.main.java.srcDirs = [ "src/" ]
sourceSets.main.resources.srcDirs = ["../core/assets"]

2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ plugins {
id 'org.jetbrains.kotlin.jvm'
}

sourceCompatibility = 1.8
sourceCompatibility = 13
group 'com.cyberbot.bomberman.core'

repositories {
Original file line number Diff line number Diff line change
@@ -316,6 +316,7 @@ private void handleContact(PlayerEntity player, Entity other) {

switch (itemType) {
case SMALL_BOMB:
case MEDIUM_BOMB:
inventory.incrementMaxQuantity(itemType, true);
default:
inventory.addItem(itemType);
Original file line number Diff line number Diff line change
@@ -408,6 +408,10 @@ private void applySnapshotToWalls(GameSnapshot snapshot) {
}

private void onEntityAdded(Entity entity) {
if (entity instanceof PlayerEntity) {
playersAlive.put(entity.getId(), ((PlayerEntity) entity).isAlive());
}

listeners.forEach(listener -> listener.onEntityAdded(entity));
}

Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ private void useItem(ItemType itemType) {
}

private void move(int direction) {
float maxVelocity = PlayerEntity.MAX_VELOCITY_BASE * player.getMaxSpeedMultiplier();
float maxVelocity = PlayerEntity.MAX_VELOCITY_RAW * player.getMaxSpeedMultiplier();
float drag = PlayerEntity.DRAG_BASE * player.getDragMultiplier();

Vector2 velocity = player.getVelocityRaw();
Original file line number Diff line number Diff line change
@@ -3,13 +3,16 @@
import com.badlogic.gdx.math.Vector2;

public class PlayerState {
/**
* The snapshot's sequence that this state describes
*/
public final int sequence;
public final Vector2 position;
public final Vector2 velocity;

public PlayerState(int sequence, Vector2 position, Vector2 velocity) {
this.sequence = sequence;
this.position = position;
this.velocity = velocity;
}

public int sequence;
public Vector2 position;
public Vector2 velocity;
}
Original file line number Diff line number Diff line change
@@ -16,32 +16,24 @@

public class PlayerEntity extends Entity {
public static final float MAX_VELOCITY = 5;
public static final float MAX_VELOCITY_BASE = MAX_VELOCITY * PPM;
public static final float MAX_VELOCITY_RAW = MAX_VELOCITY * PPM;
public static final float DRAG_BASE = 60f;

private static final float ANIMATION_DURATION = 0.2f;

private Fixture fixture;
private Inventory inventory;
private final int textureVariant;

private float dragMultiplier;
private float maxSpeedMultiplier;

private PlayerState currentState;
private PlayerState previousState;

private LookingDirection verticalDirection;
private LookingDirection horizontalDirection;

private int hp;

public int getHp() {
return hp;
}

public void setHp(int hp) {
if(hp < 0 || hp > 100) {
if (hp < 0 || hp > 100) {
throw new IllegalArgumentException("HP value must be between 0 and 100");
}

@@ -59,10 +51,6 @@ public void takeDamage(float power) {
public PlayerEntity(World world, PlayerDef def, long id) {
super(world, id);

currentState = PlayerState.STANDING;
previousState = PlayerState.STANDING;
verticalDirection = LookingDirection.RIGHT;
horizontalDirection = null;
inventory = def.inventory;
dragMultiplier = def.dragModifier;
maxSpeedMultiplier = def.maxSpeedModifier;
@@ -106,29 +94,6 @@ public void setInventory(Inventory inventory) {
this.inventory = inventory;
}

private PlayerState getState() {
if (getVelocityRaw().x == 0 && getVelocityRaw().y == 0)
return PlayerState.STANDING;

if (getVelocityRaw().x != 0 && verticalDirection != null)
return PlayerState.MOVING_SIDE;

if (horizontalDirection == LookingDirection.UP)
return PlayerState.MOVING_BACK;
else
return PlayerState.MOVING_FRONT;
}

public void setLookingDirection(LookingDirection direction) {
if (direction == LookingDirection.UP || direction == LookingDirection.DOWN) {
horizontalDirection = direction;
verticalDirection = null;
} else {
horizontalDirection = null;
verticalDirection = direction;
}
}

public void applyForce(Vector2 force) {
body.applyForceToCenter(force.x / PPM, force.y / PPM, true);
}
@@ -162,6 +127,10 @@ public boolean isDead() {
return hp == 0;
}

public boolean isAlive() {
return hp > 0;
}

@Override
public void createBody(World world) {
BodyDef def = new BodyDef();
@@ -189,18 +158,4 @@ public void update(float delta) {
public PlayerData getData() {
return new PlayerData(id, getPosition(), inventory, textureVariant, hp);
}

public enum PlayerState {
STANDING,
MOVING_BACK,
MOVING_FRONT,
MOVING_SIDE
}

public enum LookingDirection {
UP,
DOWN,
LEFT,
RIGHT
}
}
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ public int getValue() {
return value;
}

@SuppressWarnings("BooleanMethodIsAlwaysInverted")
public boolean isBomb() {
return this == SMALL_BOMB || this == MEDIUM_BOMB;
}
Original file line number Diff line number Diff line change
@@ -21,13 +21,6 @@ object SerializationUtils {
return type + o.toByteArray()
}

fun deserializeString(buf: ByteArray, offset: Int): Pair<String, Int> {
val nameLength = buf[offset]
val name = String(buf.copyOfRange(offset + 1, offset + 1 + nameLength))

return Pair(name, nameLength + 1)
}

private fun getPayloadType(o: Serializable): PayloadType {
return when (o) {
is PlayerSnapshotPacket -> PayloadType.PLAYER_SNAPSHOT
@@ -37,11 +30,4 @@ object SerializationUtils {
)
}
}
}

fun String.toBytes(): ByteArray {
val str = this.toByteArray()
val length = ByteArray(1) { str.size.toByte() }

return length + str
}
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
* An abstract base class for tiles that should contain a Box2D body.
*/
public abstract class PhysicalTile extends Tile implements Disposable {
protected Body body;
protected final Body body;

public PhysicalTile(World world, String textureName, int x, int y) {
super(textureName, x, y);
Original file line number Diff line number Diff line change
@@ -15,15 +15,9 @@
* </ul>
*/
public class TileMap implements Disposable {
private static final String TAG = TileMap.class.getSimpleName();

private static final String LAYER_BASE = "base";
private static final String LAYER_FLOOR = "floor";
private static final String LAYER_WALLS = "walls";

private TileMapLayer baseLayer;
private TileMapLayer floorLayer;
private TileMapLayer wallsLayer;
private final TileMapLayer baseLayer;
private final TileMapLayer floorLayer;
private final TileMapLayer wallsLayer;

private final List<ChangeListener> listeners;

2 changes: 1 addition & 1 deletion server/build.gradle
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ plugins {
id 'org.jetbrains.kotlin.jvm'
}

sourceCompatibility = 1.8
sourceCompatibility = 13
repositories {
mavenCentral()
}