From 4d982910790d1de3289a4f9d42e53ee4f3a0c82e Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Wed, 27 Jul 2022 16:47:18 +0200 Subject: [PATCH] Removed print statement, and improved readme. --- README.md | 57 ++++++++++++++----- .../PlayerInputMouseScrollCallback.java | 1 - 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4634c68..aa36413 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,12 @@ -# ace-of-shades-2 -A simple 3D voxel-based shooter inspired by Ace of Spades. +# Ace of Shades 2 +A simple 3D voxel-based shooter inspired by Ace of Spades. With some basic weapons and tools, fight against players in other teams! -## Configuration -Both the client and server use a similar style of YAML-based configuration, where upon booting up, the program will look for a configuration file in the current working directory with one of the following names: `configuration`, `config`, `cfg`, ending in either `.yaml` or `.yml`. Alternatively, you can provide the path to a configuration file at a different location via a single command-line argument. For example: -```bash -java -jar server.jar /path/to/my/custom/config.yaml -``` -If no configuration file is found, and none is explicitly provided, then a set of default configuration options is loaded. +## Quick-Start Guide +_Read this guide to get started and join a server in just a minute or two!_ -## Running the Game -Ace of Shades 2 uses Java 17. You'll need to install that first (or any later version), if you don't have it already. - -To run the client, go to the [releases](https://github.com/andrewlalis/ace-of-shades-2/releases) page and download the `aos2-client` file that corresponds to your system. You'll need to make a configuration file in the same directory as the JAR file, something like this: +1. Make sure you've got at least Java 17 installed. You can get it [here](https://adoptium.net/temurin/releases). +2. Download the `aos2-client` JAR file from the [releases page](https://github.com/andrewlalis/ace-of-shades-2/releases) that's compatible with your system. +3. Create a file named `config.yaml` in the same directory as the JAR file, and place the following text in it: ```yaml serverHost: localhost serverPort: 25565 @@ -23,4 +18,40 @@ display: captureCursor: true fov: 80 ``` -To connect to a particular server, you'll need to update this config file and then you can start the game with `java -jar ` or by double-clicking on it. +4. Set the `serverHost`, `serverPort`, and `username` properties accordingly for the server you want to join. +5. Run the game by double-clicking the `aos2-client` JAR file, or enter `java -jar aos2-client-{version}.jar` in a terminal. + +## Setting up a Server +Setting up a server is quite easy. Just go to the [releases page](https://github.com/andrewlalis/ace-of-shades-2/releases) and download the latest `aos2-server` JAR file. Similar to the client, it's best if you provide a `config.yaml` file to the server, in the same directory. The following snippet shows the structure and default values of a server's configuration. +```yaml +port: 25565 +connectionBacklog: 5 +ticksPerSecond: 20.0 +physics: + gravity: 29.43 + walkingSpeed: 4 + crouchingSpeed: 1.5 + sprintingSpeed: 9 + movementAcceleration: 2 + movementDeceleration: 1 + jumpVerticalSpeed: 8 +actions: + blockBreakCooldown: 0.25 + blockPlaceCooldown: 0.1 + blockBreakReach: 5 + blockPlaceReach: 5 + blockBulletDamageResistance: 3 + blockBulletDamageCooldown: 10 + resupplyCooldown: 30 + resupplyRadius: 3 + teamSpawnProtection: 10 + movementAccuracyDecreaseFactor: 0.01 + friendlyFire: false +``` + +## Configuration +Both the client and server use a similar style of YAML-based configuration, where upon booting up, the program will look for a configuration file in the current working directory with one of the following names: `configuration`, `config`, `cfg`, ending in either `.yaml` or `.yml`. Alternatively, you can provide the path to a configuration file at a different location via a single command-line argument. For example: +```bash +java -jar server.jar /path/to/my/custom/config.yaml +``` +If no configuration file is found, and none is explicitly provided, then a set of default configuration options is loaded. diff --git a/client/src/main/java/nl/andrewl/aos2_client/control/PlayerInputMouseScrollCallback.java b/client/src/main/java/nl/andrewl/aos2_client/control/PlayerInputMouseScrollCallback.java index 6890915..4bd6cd0 100644 --- a/client/src/main/java/nl/andrewl/aos2_client/control/PlayerInputMouseScrollCallback.java +++ b/client/src/main/java/nl/andrewl/aos2_client/control/PlayerInputMouseScrollCallback.java @@ -17,7 +17,6 @@ public class PlayerInputMouseScrollCallback implements GLFWScrollCallbackI { @Override public void invoke(long window, double xoffset, double yoffset) { - System.out.println(yoffset); if (client.getMyPlayer().getInventory().getSelectedItemStack() instanceof BlockItemStack stack) { if (yoffset < 0) { stack.setSelectedValue((byte) (stack.getSelectedValue() - 1));