Spaces:
Running
Running
title: 🧜♀️Streamlit🧠CV📚Scroller | |
emoji: 🧜♀️📚🧜♂️ | |
colorFrom: gray | |
colorTo: pink | |
sdk: streamlit | |
sdk_version: 1.44.1 | |
app_file: app.py | |
pinned: false | |
license: mit | |
short_description: 🧠CV Scroller🧜♀️🧜♂️🧜3D Graphs | |
- 🐍 **Python Startup** | |
- 📂 `load_plot_metadata()` → scan `saved_worlds/` for `plot_X…_Z…csv` (cached) | |
- 📑 `load_plot_objects()` → read CSV → build `ALL_INITIAL_OBJECTS` | |
- 🔒 `get_game_state()` → singleton `GameState` → load/hold `world_state.csv` | |
- 🚀 Inject → `ALL_INITIAL_OBJECTS`, `PLOTS_METADATA`, `GAME_STATE` into `index.html` | |
- 💾 **Save Flow** | |
- 🖱️ User clicks “💾 Save” → JS `getSaveDataAndPosition()` → returns JSON payload | |
- 🔄 Py parses → computes `plot_X…_Z….csv` → `save_plot_data()` writes per‑plot file | |
- ➕ `game_state.update_state()` merges into `world_state.csv` | |
- 🔁 `load_plot_metadata.clear()` + `st.rerun()` → refreshed state | |
- 🌐 **Three.js Init** | |
- 🌟 `init()` → scene, camera, lights | |
- 🛤️ `setupInitialGround()` → one plane per saved plot (or at 0,0) | |
- 👤 `setupPlayer()` → capsule mesh at center | |
- 📦 `loadInitialObjects()` → instantiate all persisted objects | |
- 🎮 **Interaction & Local State** | |
- 🖱️ `onDocumentClick()` → raycast → spawn `House/Tree/Rock…` → add to `newlyPlacedObjects` | |
- 💾 `saveUnsavedState()` → persist `newlyPlacedObjects` to `sessionStorage` | |
- 🔄 `restoreUnsavedState()` on reload → rehydrate unsaved objects | |
- 🗑️ `resetNewlyPlacedObjects()` → clear sessionStorage | |
- ⏩ **Game Loop** | |
- 🔑 `onKeyDown`/`onKeyUp` → track WASD/Arrows | |
- 🚶 `updatePlayerMovement()` → camera‑relative walk + `checkAndExpandGround()` | |
- 🌱 `checkAndExpandGround()` → add placeholder planes around player | |
- 📽️ `animate()` → movement, camera lerp, `renderer.render()` | |
- 🔄 **Collab Sync** | |
- ⏲️ `setInterval(pollGameState, 5000)` → logs or applies updated `window.GAME_STATE` | |
✨ **All set!** This ultra‑condensed outline (with emojis 🎉) covers your end‑to‑end state protocol. | |