# javaGame **Repository Path**: zhj149/java-game ## Basic Information - **Project Name**: javaGame - **Description**: 一个由javafx制作的一款2d游戏 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2026-10-14 - **Last Updated**: 2026-10-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Java Game A 2D action-adventure game developed using JavaFX. ## Project Overview This is a 2D top-down action-adventure game inspired by the classic Legend of Zelda style, built with the JavaFX technology stack. The game features core functionalities such as a tile-based map system, player character control, item collection, and a combat system. ## Technology Stack - **Language**: Java - **Graphics Framework**: JavaFX - **Build Tool**: Maven ## Project Structure ``` src/main/java/com/lt/game/ ├── basic/ # Basic components │ ├── AppStorage.java # Game storage and configuration │ ├── AssetManager.java # Asset manager │ ├── AudioManager.java # Audio manager │ ├── GameEngine.java # Game engine main loop │ └── KeyInput.java # Keyboard input handling ├── content/ │ ├── item/ # Item entities │ │ ├── Obj_Door.java # Door │ │ └── Obj_Key.java # Key │ └── role/ │ └── Player.java # Player character ├── core/ │ ├── AssetSetter.java # Asset loader │ ├── GameApp.java # Application entry point │ ├── GamePanel.java # Game panel │ └── UI.java # User interface └── logic/ ├── entity/ # Entity classes │ ├── EntityDynamic.java # Dynamic entity │ ├── EntityStatic.java # Static entity │ └── GameObject.java # Base entity ├── fsm/ # State machine │ ├── Direction.java # Direction enum │ ├── Effect.java # Effect interface │ ├── FSM.java # State machine interface │ └── StateType.java # State type enum └── bean/ └── Tile.java # Tile ``` ## Core Features - **Tile Map System**: Supports multiple map switching, including world map, dungeon, and indoor scenes - **Player Control**: Move up/down/left/right, attack, and collect items - **Item System**: Interactive items such as keys and doors - **Collision Detection**: Collision detection between tiles and entities - **Audio System**: Background music and sound effects playback - **Camera System**: Follows the player's movement ## Quick Start ### Prerequisites - JDK 8 or higher - Maven 3.x ### Build and Run ```bash # Compile the project mvn clean compile # Run the game mvn exec:java -Dexec.mainClass="com.lt.game.core.GameApp" ``` ### Keyboard Controls - **Arrow Keys**: Move the character - **Other Keys**: Refer to KeyInput.java for specific bindings ## Game Assets - `tiles/`: Map tile resources - `p1/`: Player character sprites (idle, walking, attacking, dying) - `cat/`: Alternate character sprites - `goods/`: Item images - `monster/`: Monster images - `maps/`: Map data files - `sound/`: Sound effect files ## License This project is intended solely for learning and educational purposes.