Skip to content

Commit 099ba76

Browse files
MAJOR: Game flow, Database(sqlite)
Release
2 parents 9867abf + d3d7e46 commit 099ba76

24 files changed

+2108
-20
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
jobs:
99
release:
1010
runs-on: ubuntu-latest
11+
1112
steps:
1213
- name: Checkout Repository
1314
uses: actions/checkout@v4
@@ -24,10 +25,14 @@ jobs:
2425
uses: actions/setup-node@v3
2526
with:
2627
node-version: '20.8.1'
27-
28+
2829
- name: Install Node.js dependencies
2930
run: |
30-
npm install @semantic-release/git @semantic-release/git @semantic-release/exec
31+
npm install @semantic-release/git @semantic-release/exec @semantic-release/github
32+
33+
- name: Build with Maven
34+
run: mvn clean install
35+
3136
- name: Run Semantic Release
3237
env:
3338
GITHUB_TOKEN: ${{ secrets.HANGMAN_TOKEN }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ target/classes
44
target/classes/com/example/Main.class
55
pom.xml.tag
66
*classes
7+
code structure.txt
78
pom.xml.releaseBackup
89
pom.xml.versionsBackup
910
pom.xml.next
@@ -44,4 +45,5 @@ buildNumber.properties
4445
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
4546
hs_err_pid*
4647
replay_pid*
47-
/target/classes/com/example/Main.class
48+
/target/classes/com/example/Main.class
49+
/hangman.db

.releaserc.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
1+
# plugins:
2+
# - "@semantic-release/commit-analyzer"
3+
# - "@semantic-release/release-notes-generator"
4+
# - - "@semantic-release/exec"
5+
# - verifyReleaseCmd: 'mvn versions:set -DnewVersion="${nextRelease.version}" && echo "NEXT_VERSION=${nextRelease.version}" >> build.env'
6+
# - "@semantic-release/github"
7+
# - - "@semantic-release/git"
8+
# - assets:
9+
# - pom.xml
10+
# message: "chore(release): bump ${nextRelease.version}"
11+
12+
# branches:
13+
# - "main"
14+
# - "+([0-9])?(.{+([0-9]),x}).x"
15+
116
plugins:
217
- "@semantic-release/commit-analyzer"
318
- "@semantic-release/release-notes-generator"
4-
- - "@semantic-release/exec"
5-
- verifyReleaseCmd: 'mvn versions:set -DnewVersion="${nextRelease.version}" && echo "NEXT_VERSION=${nextRelease.version}" >> build.env'
19+
- "@semantic-release/exec"
20+
verifyReleaseCmd: 'mvn versions:set -DnewVersion="${nextRelease.version}" && echo "NEXT_VERSION=${nextRelease.version}" >> build.env'
621
- "@semantic-release/github"
7-
- - "@semantic-release/git"
8-
- assets:
9-
- pom.xml
10-
message: "chore(release): bump ${nextRelease.version}"
22+
- "@semantic-release/git"
23+
assets:
24+
- target/*.jar
25+
message: "chore(release): bump ${nextRelease.version}"
1126

1227
branches:
1328
- "main"

README.md

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,96 @@ things used/will be used so far
22
- sqlite
33
- junit and mockito for testing
44
- sementic versioning and workflows
5-
- json for words
5+
- json for words
6+
7+
8+
9+
10+
# Hangman Game - Rules & Mechanics
11+
12+
## 📌 Overview
13+
The Hangman game is a word-guessing game where players try to complete a hidden word by guessing letters. Players can earn **points** for correct guesses and **scores** for winning rounds. Points can be used to **buy hints**, while scores determine leaderboard rankings.
14+
15+
---
16+
17+
## 🎯 Objectives
18+
- Correctly guess all the letters of a word before running out of attempts.
19+
- Earn **points** for each correct guess.
20+
- Earn **scores** by completing words.
21+
- Spend **points** to buy hints if stuck.
22+
- Maintain a **streak** for bonus rewards.
23+
24+
---
25+
26+
## 🏆 Score & 💰 Points System (Independent)
27+
| **Action** | **Effect on Points** | **Effect on Score** |
28+
|-------------------------------------|--------------------------------|---------------------------------|
29+
| Guess a correct letter | +1 (Easy), +2 (Medium), +3 (Hard) | No effect |
30+
| Guess a wrong letter | No effect | No effect |
31+
| Complete the word (Win) | No effect | +Total Points Earned for the Round |
32+
| Lose the round | No effect | No effect |
33+
| Win multiple games in a row | No effect | +Win Streak Bonus |
34+
35+
📌 **Points** = Earned per letter guessed correctly (used to buy hints).
36+
📌 **Scores** = Only awarded when the player **wins a round** (used for leaderboard ranking).
37+
38+
---
39+
40+
## 🎮 Game Flow
41+
1️⃣ **Main Menu**: Play Game | Pick User | View Stats | Exit.
42+
2️⃣ **Pick User** (Load | Delete | Create).
43+
3️⃣ **Play** → Pick **Category** → Pick **Difficulty** → Start Game.
44+
4️⃣ **Guess Letters**: Earn points per correct guess.
45+
5️⃣ **Win or Lose**: Win to earn a score. Losing gives no points.
46+
6️⃣ **Continue?**: Stay in the same difficulty to keep your current score.
47+
7️⃣ **Use Points for Hints** (Optional).
48+
49+
---
50+
51+
## 🛒 Hint System (Uses Points)
52+
| **Hint Type** | **Cost (Points)** |
53+
|---------------------------------|------------------|
54+
| **Reveal a random letter** | 5 Points |
55+
| **Shows the fact about the word** | 3 Points |
56+
| **Remove a wrong letter choice** | 4 Points |
57+
58+
📌 **Players can buy hints anytime using available points.**
59+
📌 **Points do NOT reset between games (carry over).**
60+
61+
---
62+
63+
## 🔥 Streak & Challenge Bonuses
64+
- **Win Streak Bonus** → Consecutive wins increase the score multiplier.
65+
- **Difficulty Progression Bonus** → Switching to a harder difficulty grants a +10% initial score boost.
66+
- **"Almost Win" Compensation** → If a player is **90% close to winning**, they get 50% of their potential score.
67+
68+
---
69+
70+
## 📜 Game Rules
71+
1️⃣ **If a player wins and continues without changing category/difficulty, the score carries over.**
72+
2️⃣ **Players only earn a score if they win the round.**
73+
3️⃣ **Points are earned per letter and used for hints.**
74+
4️⃣ **Switching difficulty resets the score but keeps points.**
75+
5️⃣ **Players lose after exceeding maximum incorrect guesses.**
76+
6️⃣ **Leaderboard is based on score, not points.**
77+
78+
---
79+
80+
## 🎯 Future Expansions
81+
- **Multiplayer Mode** with shared word pools.
82+
- **Timed Challenges** (Earn more points for faster completion).
83+
- **Daily Words & Streak Tracking**.
84+
85+
---
86+
87+
## 🛠️ Developer Notes
88+
- **`GameSession`** → Runs gameplay loop, handles score & points.
89+
- **`WordPicker`** → Selects a word based on category & difficulty.
90+
- **`DisplayManager`** → Handles UI output (static methods).
91+
- **`InputHandler`** → Manages user input.
92+
- **`DatabaseManager` (Future)** → Stores leaderboard & user data (SQLite).
93+
94+
---
95+
96+
This document serves as a **reference for coding**. You can update it as features evolve. 🚀
97+

pom.xml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,23 @@
1717
<dependencies>
1818
<!-- sqlite: JDBC -->
1919

20-
<dependency>
21-
<groupId>org.xerial</groupId>
22-
<artifactId>sqlite-jdbc</artifactId>
23-
<version>3.42.0.0</version>
24-
<scope>test</scope>
25-
</dependency>
20+
<dependency>
21+
<groupId>org.xerial</groupId>
22+
<artifactId>sqlite-jdbc</artifactId>
23+
<version>3.42.0.0</version>
24+
</dependency>
2625

26+
<dependency>
27+
<groupId>com.fasterxml.jackson.core</groupId>
28+
<artifactId>jackson-databind</artifactId>
29+
<version>2.16.1</version>
30+
</dependency>
2731

32+
<dependency>
33+
<groupId>com.googlecode.json-simple</groupId>
34+
<artifactId>json-simple</artifactId>
35+
<version>1.1.1</version>
36+
</dependency>
2837

2938
<!-- JUnit 5 -->
3039
<dependency>
@@ -47,6 +56,15 @@
4756
<version>5.6.0</version>
4857
<scope>test</scope>
4958
</dependency>
59+
60+
<dependency>
61+
<groupId>org.projectlombok</groupId>
62+
<artifactId>lombok</artifactId>
63+
<version>1.18.36</version>
64+
<scope>provided</scope>
65+
</dependency>
66+
67+
5068
</dependencies>
5169

5270

0 commit comments

Comments
 (0)