|
2 | 2 |
|
3 | 3 | ## ⚡ 10-Second Setup (EASIEST) |
4 | 4 |
|
5 | | -### Option 1: One-Click Launch |
| 5 | +### Option 1: One-Click Launch (Windows) |
6 | 6 | ```cmd |
7 | | -run.bat |
| 7 | +scripts\run.bat |
8 | 8 | ``` |
9 | 9 | ✅ **Automatically starts both servers and opens browser!** |
10 | 10 |
|
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 |
12 | 23 |
|
13 | | -#### 1. Start Server |
| 24 | +# Linux/Mac |
| 25 | +./scripts/build.sh |
| 26 | +``` |
| 27 | + |
| 28 | +#### 2. Start Server |
14 | 29 | ```bash |
15 | 30 | cd server |
16 | 31 | mvn exec:java |
17 | 32 | ``` |
18 | 33 | ✅ Server running on `ws://localhost:8080` |
19 | 34 |
|
20 | | -#### 2. Start Client |
| 35 | +#### 3. Start Client |
21 | 36 | ```bash |
22 | 37 | cd client |
23 | 38 | python -m http.server 3000 |
24 | 39 | ``` |
25 | 40 | ✅ Game at `http://localhost:3000` |
26 | 41 |
|
27 | | -#### 3. Play |
| 42 | +#### 4. Play |
28 | 43 | - Open browser → `http://localhost:3000` |
29 | 44 | - Enter name → Click "Deploy to Battle" |
30 | 45 | - Use **WASD** to move, **mouse** to aim, **click** to fire |
31 | 46 |
|
32 | 47 | --- |
33 | 48 |
|
34 | 49 | ### 🛑 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 |
39 | 53 |
|
40 | 54 | ### 📊 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 |
45 | 58 |
|
46 | 59 | --- |
47 | 60 |
|
|
0 commit comments