Skip to content
This repository was archived by the owner on Feb 22, 2026. It is now read-only.

Commit bab1e16

Browse files
Merge pull request #598 from bruhhgnik/blockrooms
Blockrooms
2 parents 55b1edd + 0cc464e commit bab1e16

File tree

101 files changed

+48310
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+48310
-0
lines changed

BlockRooms/LICENSE.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# 🕹️ BlockRooms – End User License Agreement (EULA)
2+
3+
_Last updated: July 13, 2025_
4+
5+
---
6+
7+
## 1. Acceptance
8+
9+
By using or playing BlockRooms, you agree to this End User License Agreement (EULA).
10+
11+
---
12+
13+
## 2. What You Can Do
14+
15+
You are allowed to:
16+
17+
- Play BlockRooms using the official website and connecting your Cartridge wallet.
18+
- Use the game for personal, non-commercial use.
19+
- Share screenshots or videos of gameplay for fun or feedback.
20+
21+
---
22+
23+
## 3. What You Cannot Do
24+
25+
You are **not allowed to**:
26+
27+
- Copy, sell, or reuse the game's code, assets, or smart contracts.
28+
- Reverse-engineer, modify, or re-upload the game.
29+
- Use bots, scripts, or cheats to gain unfair advantage.
30+
- Sell access to the game or use it for commercial purposes.
31+
32+
---
33+
34+
## 4. Ownership
35+
36+
All code, game logic, 3D models, designs, and content belong to **Kepler22bee Studios**.
37+
Any instances of unfair usage of in-game token economics, themes, game loop logic, or ideation will be subject to strict legal action.
38+
39+
Until the official **Token Generation Event (TGE)** or explicit **written permission** from the repository owner,
40+
**any copying of ideas, game mechanics, tokenomics, assets, or themes** is considered a violation and will be legally pursued.
41+
42+
---
43+
44+
## 5. Disclaimer
45+
46+
BlockRooms is under construction and may break, reset, or change at any time.
47+
48+
---
49+
50+
## 6. Contact
51+
52+
Have a question or issue?
53+
📧 Email us at: **blockrooms.game@gmail.com**

BlockRooms/README.md

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# 🎮 Blockrooms: Backrooms inspired FPS onchain
2+
3+
## 📘 Contents
4+
5+
- 🔗 [Our Stack](#our-stack)
6+
- 🔗 [Game Logic](#game-logic)
7+
8+
# Our-Stack
9+
10+
> A high-level breakdown of the technologies powering **BlockRooms** — from 3D graphics and frontend architecture to fully on-chain gameplay mechanics.
11+
12+
---
13+
14+
## 🎮 Frontend Stack
15+
16+
We use a robust set of modern tools to build the visual and interactive parts of BlockRooms:
17+
18+
- 🎨 **Blender** – for modeling and exporting `.gltf` assets used in our 3D game environment.
19+
- ⚛️ **React** – component-based UI library for structuring our game frontend.
20+
-**Vite** – the dev server and build tool powering the React app.
21+
- 🌐 **Three.js** (via [`@react-three/fiber`](https://docs.pmnd.rs/react-three-fiber)) – for real-time 3D rendering in WebGL.
22+
- 🕹️ **PointerLockControls** – to enable mouse-look and FPS-style movement.
23+
- 🐻 **zustand** – lightweight and scalable state manager to handle in-game data like player state, room transitions, HUD, etc.
24+
25+
---
26+
27+
## ⛓️ Onchain Game Logic (via [Dojo](https://dojoengine.org/overview))
28+
29+
The logic of the game lives entirely on-chain, built using the **Dojo Engine**:
30+
31+
- 🧱 **Dojo** – a provable game engine for Starknet. The game state (players, rooms, scores) is stored on-chain using Dojo’s ECS-style architecture.
32+
- 🔧 **dojo.js SDK** – bridges our React frontend to the onchain world. Enables typed access to components and systems using TypeScript.
33+
- 🛠️ **Sozo** – CLI tool used for compiling, testing, and deploying Dojo worlds.
34+
- 📡 **Torii** – for event indexing and real-time subscriptions to in-game events.
35+
36+
👉 **Explore Dojo documentation:** [https://docs.dojoengine.org](https://docs.dojoengine.org)
37+
38+
---
39+
40+
41+
## 🔗 Relevant Links
42+
43+
- 📚 [Dojo Docs](https://dojoengine.org/overview)
44+
45+
46+
# Game-Logic
47+
48+
This section outlines the core gameplay loop, progression mechanics, and XP logic of **BlockRooms**. It’s built to reflect both **on-chain** and **frontend** behavior.
49+
50+
---
51+
52+
## 🧩 Overview
53+
54+
- **Genre**: On-chain, zone-based shooter with progression and XP mechanics.
55+
- **Map Structure**: 3 zones → Red (8 rooms), Blue (8 rooms), Green (4 rooms)
56+
- **Objective**: Locate and eliminate the *real enemy* in each zone to unlock the next.
57+
58+
---
59+
60+
## 🔁 Game Loop Summary
61+
62+
Wallet → Join Session → Spawn in Red Zone →
63+
→ Choose Room → Read Enemy Positions → Shoot →
64+
→ If Real Enemy: Gain XP & Unlock Next Zone
65+
→ If Fake Enemy: Lose XP → Continue Searching
66+
→ Repeat for all 3 zones until exit
67+
68+
markdown
69+
Copy
70+
Edit
71+
72+
---
73+
74+
## ⚙️ Game Loop Step-by-Step
75+
76+
### 1. 🔌 Connect Wallet
77+
- Player connects their **Cartridge Wallet** to the website.
78+
79+
### 2. 👥 Join Session
80+
- Player taps **Join Session**.
81+
- A session is created **on-chain**.
82+
- Player spawns in **Red Zone**, with:
83+
- `Health = 100`
84+
- `XP = 200`
85+
86+
### 3. 🧭 Explore Red Zone
87+
- **Total Rooms**: 8 (Red Zone)
88+
- Player can only enter **one room at a time**.
89+
- In each room:
90+
- **4 positions** are shown by the frontend where enemies may appear.
91+
- These positions are **predefined** in the frontend.
92+
- However, the **frontend does not know** which is real or fake.
93+
- This info is derived from **on-chain** state.
94+
95+
### 4. ❓ Real vs. Fake Enemies
96+
- Across all 8 rooms:
97+
- Only **one** hides the **real enemy**.
98+
- Its identity is **hidden from the frontend** and **stored on-chain**.
99+
100+
---
101+
102+
## 🎯 Shooting Logic
103+
104+
| Enemy Type | Action | XP Impact | Zone Impact |
105+
|----------------|--------|------------------------|------------------------------------------|
106+
| ❌ Fake Enemy | Hit | `-1 × current_health` | Stay in current zone, keep searching |
107+
| ✅ Real Enemy | Hit | `+5 × current_health` | Unlock next zone |
108+
109+
---
110+
111+
## 💡 XP Formula
112+
113+
- **On Miss (fake):**
114+
`XP -= 1 × Health`
115+
116+
- **On Hit (real):**
117+
`XP += 5 × Health`
118+
119+
---
120+
121+
## 🔓 Zone Progression
122+
123+
Red Zone (8 rooms)
124+
→ Real enemy defeated
125+
→ Blue Zone (8 rooms)
126+
→ Real enemy defeated
127+
→ Green Zone (4 rooms)
128+
→ Game Completed
129+
130+
yaml
131+
Copy
132+
Edit
133+
134+
- Once the real enemy in a zone is defeated:
135+
- The next zone is unlocked
136+
- Health and XP are retained
137+
- If **Health = 0**, player may be prevented from progressing.
138+
139+
---
140+
141+
## 🧠 On-Chain vs. Frontend Responsibilities
142+
143+
| Layer | Responsibility |
144+
|---------------|-----------------------------------------------------|
145+
| **Frontend** | Renders rooms, enemy visuals, manages input |
146+
| **On-Chain** | Chooses real enemy, calculates XP, controls state |
147+
| **Dojo ECS** | Stores health, XP, room state, and logs events |
148+
149+
---
150+
151+
## 🔗 Session End Conditions
152+
153+
- Player defeats the real enemy in the **Green Zone**.
154+
- The system may record:
155+
- ✅ Final XP
156+
- ⏱️ Time taken
157+
- 🎯 Shots fired
158+
159+
---
160+
161+
## ⚠️ Disclaimer: Zone Difficulty Scaling
162+
163+
> The above loop repeats across zones, but XP values change to increase challenge.
164+
165+
### 🔵 Blue Zone (8 Rooms)
166+
167+
- **Fake Enemy Shot**: `-1.5 × Health`
168+
- **Real Enemy Shot**: `+10 × Health`
169+
- **Total Positions**: `8 × 4 = 32`
170+
171+
### 🟢 Green Zone (4 Rooms)
172+
173+
- **Fake Enemy Shot**: `-4 × Health`
174+
- **Real Enemy Shot**: `+15 × Health`
175+
- **Total Positions**: `4 × 4 = 16`
176+
177+
---
178+
179+
180+

BlockRooms/client/.env.example

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
```````````` # Deploy Environment Variables
2+
VITE_PUBLIC_DEPLOY_TYPE=sepolia
3+
VITE_PUBLIC_NODE_URL=https://api.cartridge.gg/x/starknet/sepolia
4+
VITE_PUBLIC_TORII=https://api.cartridge.gg/x/blockrooms/torii
5+
VITE_PUBLIC_MASTER_ADDRESS=DEPLOYER_ACCOUNT_ADDRESS
6+
VITE_PUBLIC_MASTER_PRIVATE_KEY=DEPLOYER_PRIVATE_KEY
7+
VITE_PUBLIC_SLOT_ADDRESS=KATANA_ADDRESS
8+
9+
# Local HTTPS flag
10+
VITE_LOCAL_HTTPS=HTTPS_FLAG
11+
12+
# PostHog Config
13+
VITE_POSTHOG_API_KEY=POSTHOG_KEY
14+
VITE_POSTHOG_HOST=POSTHOG_HOST
15+
````````````

BlockRooms/client/.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
# Dependency directories
11+
node_modules
12+
dist
13+
dist-ssr
14+
dev-dist
15+
.pnpm-store
16+
17+
# Environment and local settings
18+
*.local
19+
.env
20+
21+
# mkcert certificates
22+
dev-key.pem
23+
dev.pem
24+
localhost*.pem
25+
localhost*-key.pem
26+
mkcert+1-key.pem
27+
mkcert+1.pem
28+
29+
# Editor directories and files
30+
.vscode/*
31+
!.vscode/extensions.json
32+
.idea
33+
.DS_Store
34+
*.suo
35+
*.ntvs*
36+
*.njsproj
37+
*.sln
38+
*.sw?

0 commit comments

Comments
 (0)