chore: Minor changes
This commit is contained in:
31
README.md
Normal file
31
README.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# Terminal Game
|
||||||
|
|
||||||
|
A multiplayer terminal-based game built with Java, utilizing WebSockets for communication and Lanterna for the text-based user interface.
|
||||||
|
|
||||||
|
## Project Structure
|
||||||
|
|
||||||
|
* **game**: Client application (TUI).
|
||||||
|
* **server**: WebSocket server.
|
||||||
|
* **common**: Shared libraries and logic.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
* Java 25
|
||||||
|
* Maven
|
||||||
|
|
||||||
|
## How to Run
|
||||||
|
|
||||||
|
1. Build the project:
|
||||||
|
```bash
|
||||||
|
mvn clean install
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Start the server:
|
||||||
|
```bash
|
||||||
|
mvn compile exec:java -pl server -am
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Start the client (in a new terminal):
|
||||||
|
```bash
|
||||||
|
mvn compile exec:java -pl game -am
|
||||||
|
```
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package cz.jzitnik.client.game.items.types;
|
||||||
|
|
||||||
|
public class BeastSkin implements ItemType<BeastSkin> {
|
||||||
|
@Override
|
||||||
|
public Class<BeastSkin> getItemType() {
|
||||||
|
return BeastSkin.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,7 +12,9 @@ import cz.jzitnik.client.game.items.types.weapons.Sword;
|
|||||||
@JsonSubTypes({
|
@JsonSubTypes({
|
||||||
@JsonSubTypes.Type(value = Food.class, name = "food"),
|
@JsonSubTypes.Type(value = Food.class, name = "food"),
|
||||||
@JsonSubTypes.Type(value = Sword.class, name = "weapon_sword"),
|
@JsonSubTypes.Type(value = Sword.class, name = "weapon_sword"),
|
||||||
@JsonSubTypes.Type(value = Junk.class, name = "junk")
|
@JsonSubTypes.Type(value = Junk.class, name = "junk"),
|
||||||
|
@JsonSubTypes.Type(value = Key.class, name = "key"),
|
||||||
|
@JsonSubTypes.Type(value = BeastSkin.class, name = "beast_skin"),
|
||||||
})
|
})
|
||||||
public interface ItemType<T> {
|
public interface ItemType<T> {
|
||||||
Class<T> getItemType();
|
Class<T> getItemType();
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package cz.jzitnik.client.game.items.types;
|
||||||
|
|
||||||
|
public class Key implements ItemType<Key> {
|
||||||
|
@Override
|
||||||
|
public Class<Key> getItemType() {
|
||||||
|
return Key.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -75,15 +75,15 @@
|
|||||||
answers:
|
answers:
|
||||||
- answer: "I have it"
|
- answer: "I have it"
|
||||||
requirement:
|
requirement:
|
||||||
item: "quest_item_boss_skin"
|
item: "BeastSkin"
|
||||||
dialog:
|
dialog:
|
||||||
text: "Well done. Here is the key."
|
text: "Well done. Here is the key."
|
||||||
onEnd:
|
onEnd:
|
||||||
type: "give_item"
|
type: "give_item"
|
||||||
item:
|
item:
|
||||||
id: 800
|
id: 800
|
||||||
name: "Something"
|
name: "Key"
|
||||||
type: { name: "junk" }
|
type: { name: "key" }
|
||||||
texture: "APPLE"
|
texture: "APPLE"
|
||||||
then: { type: end }
|
then: { type: end }
|
||||||
- answer: "Not yet"
|
- answer: "Not yet"
|
||||||
@@ -114,7 +114,7 @@
|
|||||||
itemsDrops:
|
itemsDrops:
|
||||||
- id: 200
|
- id: 200
|
||||||
name: "Beast Skin"
|
name: "Beast Skin"
|
||||||
type: { name: "junk" }
|
type: { name: "beast_skin" }
|
||||||
texture: "BOSS_SKIN"
|
texture: "BOSS_SKIN"
|
||||||
tasks:
|
tasks:
|
||||||
- type: "following_player"
|
- type: "following_player"
|
||||||
@@ -137,11 +137,8 @@
|
|||||||
- id: "final_room"
|
- id: "final_room"
|
||||||
texture: "ROOM6"
|
texture: "ROOM6"
|
||||||
requirement:
|
requirement:
|
||||||
item: "quest_item_final_key"
|
item: "Key"
|
||||||
end: true
|
end: true
|
||||||
#objects:
|
|
||||||
# - objectType: "exit"
|
|
||||||
# cords: { x: 140, y: 40 }
|
|
||||||
west: null
|
west: null
|
||||||
east: null
|
east: null
|
||||||
north: null
|
north: null
|
||||||
|
|||||||
Reference in New Issue
Block a user