Skip to content

Commit ca9f76c

Browse files
committed
Enhance setup instructions and add build scripts for easier game launch
1 parent a604d2c commit ca9f76c

6 files changed

Lines changed: 104 additions & 17 deletions

File tree

README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,47 @@ A **production-grade** top-view multiplayer shooter game with professional UI/UX
5858

5959
### Installation
6060

61+
#### Option 1: One-Click Launch (Recommended)
62+
```bash
63+
# Windows
64+
scripts\run.bat
65+
66+
# Linux/Mac
67+
./scripts/run.sh
68+
```
69+
**Automatically starts both servers and opens browser!**
70+
71+
#### Option 2: Manual Setup
72+
6173
1. **Clone or navigate to the game directory**
6274
```bash
6375
cd Game
6476
```
6577

66-
2. **Start the Server**
78+
2. **Build the Server (Optional)**
79+
```bash
80+
# Windows
81+
scripts\build.bat
82+
83+
# Linux/Mac
84+
./scripts/build.sh
85+
```
86+
87+
3. **Start the Server**
6788
```bash
6889
cd server
6990
mvn clean compile exec:java
7091
```
7192
Server runs on `ws://localhost:8080/game`
7293

73-
3. **Start the Client Server**
94+
4. **Start the Client Server**
7495
```bash
7596
cd client
7697
python -m http.server 3000
7798
```
7899
Open `http://localhost:3000` in your browser
79100

80-
4. **Play!**
101+
5. **Play!**
81102
- Enter your callsign
82103
- Click "Deploy to Battle"
83104
- Use WASD to move, mouse to aim, click to fire

docs/QUICKSTART.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,59 @@
22

33
## ⚡ 10-Second Setup (EASIEST)
44

5-
### Option 1: One-Click Launch
5+
### Option 1: One-Click Launch (Windows)
66
```cmd
7-
run.bat
7+
scripts\run.bat
88
```
99
**Automatically starts both servers and opens browser!**
1010

11-
### Option 2: Manual Setup
11+
### Option 2: One-Click Launch (Linux/Mac)
12+
```bash
13+
./scripts/run.sh
14+
```
15+
**Automatically starts both servers and opens browser!**
16+
17+
### Option 3: Manual Setup
18+
19+
#### 1. Build Server (Optional)
20+
```bash
21+
# Windows
22+
scripts\build.bat
1223

13-
#### 1. Start Server
24+
# Linux/Mac
25+
./scripts/build.sh
26+
```
27+
28+
#### 2. Start Server
1429
```bash
1530
cd server
1631
mvn exec:java
1732
```
1833
✅ Server running on `ws://localhost:8080`
1934

20-
#### 2. Start Client
35+
#### 3. Start Client
2136
```bash
2237
cd client
2338
python -m http.server 3000
2439
```
2540
✅ Game at `http://localhost:3000`
2641

27-
#### 3. Play
42+
#### 4. Play
2843
- Open browser → `http://localhost:3000`
2944
- Enter name → Click "Deploy to Battle"
3045
- Use **WASD** to move, **mouse** to aim, **click** to fire
3146

3247
---
3348

3449
### 🛑 Stop the Game
35-
```cmd
36-
stop.bat
37-
```
38-
**Stops all servers cleanly**
50+
- **Windows**: Close the command prompt window that was opened by `run.bat`
51+
- **Linux/Mac**: Press `Ctrl+C` in the terminal where `run.sh` is running
52+
- The servers will stop automatically when the script is terminated
3953

4054
### 📊 Check Server Status
41-
```cmd
42-
status.bat
43-
```
44-
**Shows if servers are running**
55+
- **Server**: Check if port 8080 is listening: `netstat -an | find "8080"` (Windows) or `netstat -tlnp | grep 8080` (Linux)
56+
- **Client**: Check if port 3000 is listening: `netstat -an | find "3000"` (Windows) or `netstat -tlnp | grep 3000` (Linux)
57+
- Or simply try opening `http://localhost:3000` in your browser
4558

4659
---
4760

scripts/build.bat

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@echo off
2+
echo Building Mini Tank Fire Game...
3+
4+
REM Build server
5+
cd server
6+
mvn clean compile
7+
cd ..
8+
9+
echo Build complete!

scripts/build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
echo "Building Mini Tank Fire Game..."
3+
4+
# Build server
5+
cd server
6+
mvn clean compile
7+
cd ..
8+
9+
echo "Build complete!"
File renamed without changes.

scripts/run.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
echo "Starting Mini Tank Fire Game..."
3+
4+
# Start server in background
5+
cd server
6+
mvn exec:java &
7+
SERVER_PID=$!
8+
cd ..
9+
10+
# Wait a bit for server to start
11+
sleep 3
12+
13+
# Start client server in background
14+
cd client
15+
python3 -m http.server 3000 --bind 0.0.0.0 &
16+
CLIENT_PID=$!
17+
cd ..
18+
19+
# Wait a bit for client to start
20+
sleep 2
21+
22+
# Open browser (if xdg-open is available)
23+
if command -v xdg-open > /dev/null; then
24+
xdg-open http://localhost:3000
25+
elif command -v open > /dev/null; then
26+
open http://localhost:3000
27+
fi
28+
29+
echo "Game is running! Server on ws://localhost:8080, Client on http://localhost:3000"
30+
echo "For LAN multiplayer: Tell friends to visit http://[YOUR_LAN_IP]:3000 and enter your LAN IP in the server address field"
31+
echo "Press Ctrl+C to exit (servers will keep running)"
32+
33+
# Wait for user interrupt
34+
trap "echo 'Stopping servers...'; kill $SERVER_PID $CLIENT_PID 2>/dev/null; exit" INT
35+
wait

0 commit comments

Comments
 (0)