Skip to content

Commit a604d2c

Browse files
committed
Add gameplay and quick start guides, implement server and game logic
- Created GAMEPLAY.md for detailed gameplay instructions and strategies. - Created QUICKSTART.md for easy setup and controls. - Updated run.bat to streamline server startup process. - Added Maven configuration (pom.xml) for server dependencies. - Implemented Bullet, Player, PowerUp, and Message classes for game mechanics. - Developed GameRoom and GameServer classes to manage game state and WebSocket connections. - Added GameWebSocket class to handle player interactions and messaging.
1 parent fa7a09d commit a604d2c

17 files changed

Lines changed: 52 additions & 46 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy frontend to GitHub Pages
1+
name: Deploy client to GitHub Pages
22

33
on:
44
push:
@@ -22,10 +22,10 @@ jobs:
2222
- name: Setup Pages
2323
uses: actions/configure-pages@v5
2424

25-
- name: Upload frontend folder
25+
- name: Upload client folder
2626
uses: actions/upload-pages-artifact@v3
2727
with:
28-
path: frontend
28+
path: client
2929

3030
- name: Deploy to GitHub Pages
3131
id: deployment

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,18 @@ A **production-grade** top-view multiplayer shooter game with professional UI/UX
4242
- **Speed Indicators**: Visual effect for speed boost
4343
- **Tank Customization**: Different colors for self/enemies
4444

45-
## 🚀 Quick Start
45+
## � Documentation
46+
47+
- **[Quick Start Guide](docs/QUICKSTART.md)** - Step-by-step setup and first match checklist
48+
- **[Gameplay Guide](docs/GAMEPLAY.md)** - Detailed tactics, strategies, and advanced gameplay
49+
- **[Deployment Guide](docs/DEPLOYMENT.md)** - Production server setup and scaling
50+
51+
## �🚀 Quick Start
4652

4753
### Prerequisites
48-
- **Java 11+** (for backend)
54+
- **Java 11+** (for server)
4955
- **Maven** (build tool)
50-
- **Python 3** (for serving frontend)
56+
- **Python 3** (for serving client)
5157
- **Modern Browser** (Chrome, Firefox, Edge)
5258

5359
### Installation
@@ -57,16 +63,16 @@ A **production-grade** top-view multiplayer shooter game with professional UI/UX
5763
cd Game
5864
```
5965

60-
2. **Start the Backend Server**
66+
2. **Start the Server**
6167
```bash
62-
cd backend
68+
cd server
6369
mvn clean compile exec:java
6470
```
6571
Server runs on `ws://localhost:8080/game`
6672

67-
3. **Start the Frontend Server**
73+
3. **Start the Client Server**
6874
```bash
69-
cd frontend
75+
cd client
7076
python -m http.server 3000
7177
```
7278
Open `http://localhost:3000` in your browser
@@ -90,9 +96,9 @@ A **production-grade** top-view multiplayer shooter game with professional UI/UX
9096

9197
## 🏗️ Architecture
9298

93-
### Backend (Java)
99+
### Server (Java)
94100
```
95-
backend/
101+
server/
96102
├── pom.xml # Maven configuration
97103
└── src/main/java/com/minitankfire/
98104
├── GameServer.java # Jetty WebSocket server
@@ -110,9 +116,9 @@ backend/
110116
- **State Sync**: Broadcasts game state every frame
111117
- **Voice Signaling**: WebRTC offer/answer/ICE forwarding
112118

113-
### Frontend (Web)
119+
### Client (Web)
114120
```
115-
frontend/
121+
client/
116122
├── index.html # Game UI structure
117123
├── css/
118124
│ └── style.css # Professional styling
@@ -232,12 +238,12 @@ this.canvas.height = 800;
232238

233239
| Layer | Technology | Version |
234240
|-------|-----------|---------|
235-
| **Backend** | Java | 11+ |
241+
| **Server** | Java | 11+ |
236242
| **Server Framework** | Eclipse Jetty | 9.4.51 |
237243
| **WebSocket** | Jetty WebSocket API | 9.4.51 |
238244
| **JSON** | Gson | 2.10.1 |
239245
| **Build Tool** | Maven | 3.x |
240-
| **Frontend** | HTML5 Canvas | - |
246+
| **Client** | HTML5 Canvas | - |
241247
| **JavaScript** | Vanilla ES6 | - |
242248
| **Voice** | WebRTC | - |
243249
| **Icons** | Font Awesome | 6.4.0 |
@@ -246,7 +252,7 @@ this.canvas.height = 800;
246252

247253
### Building
248254
```bash
249-
cd backend
255+
cd server
250256
mvn clean compile
251257
```
252258

@@ -268,7 +274,7 @@ java -jar target/minitankfire-server-1.0-SNAPSHOT.jar
268274
- Ensure Java 11+ is installed
269275
- Run `mvn clean compile` first
270276

271-
### Frontend issues
277+
### Client issues
272278
- Clear browser cache (Ctrl+F5)
273279
- Check console for errors (F12)
274280
- Verify server is running on port 8080
File renamed without changes.
File renamed without changes.

DEPLOYMENT.md renamed to docs/DEPLOYMENT.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ This guide covers deploying **Mini Tank Fire: Online** to production servers for
1818

1919
### Software
2020
- Maven 3.6+
21-
- Nginx (for frontend hosting)
21+
- Nginx (for client hosting)
2222
- SSL certificate (Let's Encrypt recommended)
2323
- Domain name (optional but recommended)
2424

2525
---
2626

27-
## 🔧 Backend Deployment
27+
## 🔧 Server Deployment
2828

2929
### 1. Build Production JAR
3030

3131
```bash
32-
cd backend
32+
cd server
3333
mvn clean package
3434
```
3535

@@ -92,11 +92,11 @@ sudo ufw allow 443/tcp
9292

9393
---
9494

95-
## 🌐 Frontend Deployment
95+
## 🌐 Client Deployment
9696

9797
### 1. Update WebSocket URL
9898

99-
Edit `frontend/js/game.js` line 309:
99+
Edit `client/js/game.js` line 309:
100100

101101
```javascript
102102
// Change from
@@ -133,7 +133,7 @@ server {
133133
ssl_protocols TLSv1.2 TLSv1.3;
134134
ssl_ciphers HIGH:!aNULL:!MD5;
135135
136-
# Frontend static files
136+
# Client static files
137137
root /var/www/minitankfire;
138138
index index.html;
139139
@@ -169,12 +169,12 @@ server {
169169
}
170170
```
171171

172-
### 3. Deploy Frontend
172+
### 3. Deploy Client
173173

174174
```bash
175175
# Copy files
176176
sudo mkdir -p /var/www/minitankfire
177-
sudo cp -r frontend/* /var/www/minitankfire/
177+
sudo cp -r client/* /var/www/minitankfire/
178178
sudo chown -R www-data:www-data /var/www/minitankfire
179179

180180
# Enable site
@@ -414,15 +414,15 @@ jobs:
414414
java-version: '11'
415415

416416
- name: Build with Maven
417-
run: cd backend && mvn clean package
417+
run: cd server && mvn clean package
418418

419419
- name: Deploy to server
420420
uses: appleboy/scp-action@master
421421
with:
422422
host: ${{ secrets.SERVER_HOST }}
423423
username: ${{ secrets.SERVER_USER }}
424424
key: ${{ secrets.SERVER_SSH_KEY }}
425-
source: "backend/target/*.jar,frontend/*"
425+
source: "server/target/*.jar,client/*"
426426
target: "/opt/minitankfire"
427427

428428
- name: Restart service
File renamed without changes.

QUICKSTART.md renamed to docs/QUICKSTART.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ run.bat
1010

1111
### Option 2: Manual Setup
1212

13-
#### 1. Start Backend
13+
#### 1. Start Server
1414
```bash
15-
cd backend
15+
cd server
1616
mvn exec:java
1717
```
1818
✅ Server running on `ws://localhost:8080`
1919

20-
#### 2. Start Frontend
20+
#### 2. Start Client
2121
```bash
22-
cd frontend
22+
cd client
2323
python -m http.server 3000
2424
```
2525
✅ Game at `http://localhost:3000`
@@ -99,8 +99,8 @@ Voice: Click 🎤 icon (top-right)
9999

100100
### Server won't start
101101
```bash
102-
# Make sure you're in the backend folder
103-
cd Game/backend
102+
# Make sure you're in the server folder
103+
cd Game/server
104104
mvn clean compile
105105
mvn exec:java
106106
```
@@ -136,13 +136,13 @@ mvn exec:java
136136
## 🔧 Advanced
137137

138138
### Change Port
139-
**Backend:**
139+
**Server:**
140140
```java
141141
// GameServer.java, line 10
142142
Server server = new Server(8080); // Change to your port
143143
```
144144

145-
**Frontend:**
145+
**Client:**
146146
```javascript
147147
// game.js, line 309
148148
this.ws = new WebSocket('ws://localhost:8080/game'); // Update port
@@ -171,16 +171,16 @@ private static final int MAP_HEIGHT = 800;
171171

172172
## 📖 Full Documentation
173173

174-
- **README.md** - Complete feature list, architecture
175-
- **GAMEPLAY.md** - Detailed tactics, strategies, tips
174+
- **[README.md](../README.md)** - Complete feature list, architecture
175+
- **[GAMEPLAY.md](GAMEPLAY.md)** - Detailed tactics, strategies, tips
176176
- **Code Comments** - Inline documentation in source files
177177

178178
---
179179

180180
## 🎯 First Match Checklist
181181

182182
- [ ] Server running (check terminal)
183-
- [ ] Frontend accessible (check browser)
183+
- [ ] Client accessible (check browser)
184184
- [ ] Entered callsign
185185
- [ ] Can move with WASD
186186
- [ ] Can aim with mouse

run.bat

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
@echo off
22
echo Starting Mini Tank Fire Game...
33

4-
REM Start backend server in background
5-
cd backend
4+
REM Start server in background
5+
cd server
66
start /b mvn exec:java
77
cd ..
88

9-
REM Wait a bit for backend to start
9+
REM Wait a bit for server to start
1010
timeout /t 3 /nobreak > nul
1111

12-
REM Start frontend server in background
13-
cd frontend
12+
REM Start client server in background
13+
cd client
1414
start /b python -m http.server 3000 --bind 0.0.0.0
1515
cd ..
1616

17-
REM Wait a bit for frontend to start
17+
REM Wait a bit for client to start
1818
timeout /t 2 /nobreak > nul
1919

2020
REM Open browser
2121
start http://localhost:3000
2222

23-
echo Game is running! Backend on ws://localhost:8080, Frontend on http://localhost:3000
23+
echo Game is running! Server on ws://localhost:8080, Client on http://localhost:3000
2424
echo For LAN multiplayer: Tell friends to visit http://[YOUR_LAN_IP]:3000 and enter your LAN IP in the server address field
2525
echo Press any key to exit this window (servers will keep running)
2626
pause > nul
File renamed without changes.

0 commit comments

Comments
 (0)