Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,102 +8,11 @@ from streamlit_flow import streamlit_flow
|
|
8 |
from streamlit_flow.elements import StreamlitFlowNode, StreamlitFlowEdge
|
9 |
from streamlit_flow.layouts import TreeLayout
|
10 |
|
11 |
-
#
|
12 |
-
|
|
|
13 |
|
14 |
-
#
|
15 |
-
SITUATIONS = [
|
16 |
-
{
|
17 |
-
"id": "feline_escape",
|
18 |
-
"name": "The Great Feline Escape",
|
19 |
-
"description": "Your cat rider is trapped in an old mansion, which is about to be demolished. Using agility, wit, and bravery, orchestrate the perfect escape.",
|
20 |
-
"emoji": "๐ช",
|
21 |
-
"type": "escape",
|
22 |
-
"variations": [
|
23 |
-
"Sneak through creaky floorboards ๐ฆถ",
|
24 |
-
"Navigate a maze of mirrors ๐ช",
|
25 |
-
"Outsmart the demolition crew ๐ท",
|
26 |
-
"Find a secret passage ๐ต๏ธ",
|
27 |
-
"Tame a guard dog ๐",
|
28 |
-
"Climb down from the attic ๐ช",
|
29 |
-
"Distract the caretaker ๐ด",
|
30 |
-
"Ride a dumbwaiter to safety ๐ฆ",
|
31 |
-
"Use curtains as a makeshift rope ๐ชข",
|
32 |
-
"Slide down the chimney ๐ "
|
33 |
-
]
|
34 |
-
},
|
35 |
-
{
|
36 |
-
"id": "lost_temple",
|
37 |
-
"name": "The Treasure of the Lost Temple",
|
38 |
-
"description": "On a quest to retrieve an ancient artifact, your cat rider must navigate through a labyrinth filled with traps and guardian spirits.",
|
39 |
-
"emoji": "๐๏ธ",
|
40 |
-
"type": "exploration",
|
41 |
-
"variations": [
|
42 |
-
"Decipher ancient hieroglyphs ๐",
|
43 |
-
"Cross a rickety bridge ๐",
|
44 |
-
"Dodge poison darts ๐ฏ",
|
45 |
-
"Solve a stone puzzle ๐งฉ",
|
46 |
-
"Appease an angry spirit ๐ป",
|
47 |
-
"Navigate a pitch-black cavern ๐ฏ๏ธ",
|
48 |
-
"Retrieve a gem from a statue's eye ๐",
|
49 |
-
"Swim through an underground river ๐",
|
50 |
-
"Climb a crumbling tower ๐ผ",
|
51 |
-
"Outwit a cunning sphinx ๐ฆ"
|
52 |
-
]
|
53 |
-
},
|
54 |
-
{
|
55 |
-
"id": "royal_tournament",
|
56 |
-
"name": "The Royal Tournament",
|
57 |
-
"description": "Compete in a grand tournament where the finest cat riders showcase their skills and bravery to earn the title of the Royal Rider.",
|
58 |
-
"emoji": "๐",
|
59 |
-
"type": "competition",
|
60 |
-
"variations": [
|
61 |
-
"Race through an obstacle course ๐",
|
62 |
-
"Perform acrobatic stunts ๐คธ",
|
63 |
-
"Win a jousting match ๐ญ",
|
64 |
-
"Showcase elegant dressage ๐",
|
65 |
-
"Complete a scavenger hunt ๐",
|
66 |
-
"Demonstrate cat-whispering skills ๐บ",
|
67 |
-
"Win a battle of wits ๐ง ",
|
68 |
-
"Prove your valor in mock combat โ๏ธ",
|
69 |
-
"Navigate a magical maze ๐",
|
70 |
-
"Impress the royal judges ๐จโโ๏ธ"
|
71 |
-
]
|
72 |
-
}
|
73 |
-
]
|
74 |
-
|
75 |
-
ACTIONS = [
|
76 |
-
{
|
77 |
-
"id": "stealth",
|
78 |
-
"name": "Use Stealth",
|
79 |
-
"description": "Sneak past obstacles or enemies without being detected.",
|
80 |
-
"emoji": "๐คซ",
|
81 |
-
"type": "skill"
|
82 |
-
},
|
83 |
-
{
|
84 |
-
"id": "agility",
|
85 |
-
"name": "Showcase Agility",
|
86 |
-
"description": "Perform impressive acrobatic maneuvers to overcome challenges.",
|
87 |
-
"emoji": "๐",
|
88 |
-
"type": "physical"
|
89 |
-
},
|
90 |
-
{
|
91 |
-
"id": "charm",
|
92 |
-
"name": "Charm Others",
|
93 |
-
"description": "Use your cat's natural charisma to win over allies or distract foes.",
|
94 |
-
"emoji": "๐ป",
|
95 |
-
"type": "social"
|
96 |
-
},
|
97 |
-
{
|
98 |
-
"id": "resourcefulness",
|
99 |
-
"name": "Be Resourceful",
|
100 |
-
"description": "Utilize the environment or items in creative ways to solve problems.",
|
101 |
-
"emoji": "๐ง ",
|
102 |
-
"type": "mental"
|
103 |
-
}
|
104 |
-
]
|
105 |
-
|
106 |
-
# ๐ฒ Game Mechanics
|
107 |
def generate_situation():
|
108 |
return random.choice(SITUATIONS)
|
109 |
|
@@ -113,98 +22,55 @@ def generate_actions():
|
|
113 |
def evaluate_action(action, gear_strength, rider_skill, history):
|
114 |
base_success_chance = (gear_strength + rider_skill) / 2
|
115 |
if action['id'] in history:
|
116 |
-
success_chance = base_success_chance + (history[action['id']] *
|
117 |
else:
|
118 |
success_chance = base_success_chance
|
119 |
-
success_chance = min(success_chance, 95) # Cap at 95% chance
|
120 |
outcome = random.randint(1, 100) <= success_chance
|
121 |
return outcome, success_chance
|
122 |
|
123 |
def generate_encounter_conclusion(situation, action, outcome):
|
|
|
124 |
if outcome:
|
125 |
conclusions = [
|
126 |
-
f"Your {action['name']} was successful! You've overcome the challenges of {situation['name']}.",
|
127 |
-
f"Through clever use of {action['name']}, you've triumphed in the {situation['name']}!",
|
128 |
-
f"Your mastery of {action['name']}
|
129 |
]
|
130 |
else:
|
131 |
conclusions = [
|
132 |
-
f"Despite your efforts with {action['name']}, you'
|
133 |
-
f"Your attempt at {action['name']} wasn't enough
|
134 |
-
f"The challenges of {situation['name']} proved too great
|
135 |
]
|
136 |
return random.choice(conclusions)
|
137 |
|
138 |
def update_character_stats(game_state, outcome):
|
|
|
139 |
if outcome:
|
140 |
game_state['gear_strength'] = min(10, game_state['gear_strength'] + random.uniform(0.1, 0.5))
|
141 |
game_state['rider_skill'] = min(10, game_state['rider_skill'] + random.uniform(0.1, 0.5))
|
142 |
return game_state
|
143 |
|
144 |
-
# ๐ณ Journey Visualization with Heterogeneous Graph Structure
|
145 |
def create_heterogeneous_graph(history_df):
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
# Define node shapes based on situation and action types
|
150 |
-
situation_shapes = {
|
151 |
-
"escape": "diamond",
|
152 |
-
"exploration": "triangle",
|
153 |
-
"competition": "star"
|
154 |
-
}
|
155 |
-
action_shapes = {
|
156 |
-
"skill": "square",
|
157 |
-
"physical": "circle",
|
158 |
-
"social": "hexagon",
|
159 |
-
"mental": "octagon"
|
160 |
-
}
|
161 |
-
|
162 |
-
for index, row in history_df.iterrows():
|
163 |
-
situation_id = f"situation-{index}"
|
164 |
-
action_id = f"action-{index}"
|
165 |
-
conclusion_id = f"conclusion-{index}"
|
166 |
-
|
167 |
-
# Create situation node
|
168 |
-
situation_content = f"{row['situation_emoji']} {row['situation_name']}\n{row['variation']}\n๐ {row['timestamp']}"
|
169 |
-
situation_node = StreamlitFlowNode(situation_id, (0, 0), {'content': situation_content}, 'output', 'bottom', 'top', shape=situation_shapes[row['situation_type']])
|
170 |
-
nodes.append(situation_node)
|
171 |
-
|
172 |
-
# Create action node
|
173 |
-
action_content = f"{row['action_emoji']} {row['action_name']}\nOutcome: {'โ
Success' if row['outcome'] else 'โ Failure'}"
|
174 |
-
action_node = StreamlitFlowNode(action_id, (0, 0), {'content': action_content}, 'output', 'bottom', 'top', shape=action_shapes[row['action_type']])
|
175 |
-
nodes.append(action_node)
|
176 |
-
|
177 |
-
# Create conclusion node
|
178 |
-
conclusion_content = f"๐ {row['conclusion']}\n๐ช Gear: {row['gear_strength']:.2f} | ๐๏ธ Skill: {row['rider_skill']:.2f}"
|
179 |
-
conclusion_node = StreamlitFlowNode(conclusion_id, (0, 0), {'content': conclusion_content}, 'output', 'bottom', 'top', shape='parallelogram')
|
180 |
-
nodes.append(conclusion_node)
|
181 |
-
|
182 |
-
# Create edges
|
183 |
-
edges.append(StreamlitFlowEdge(f"{situation_id}-{action_id}", situation_id, action_id, animated=True, dashed=False))
|
184 |
-
edges.append(StreamlitFlowEdge(f"{action_id}-{conclusion_id}", action_id, conclusion_id, animated=True, dashed=False))
|
185 |
-
|
186 |
-
# Create edge to previous conclusion if not the first node
|
187 |
-
if index > 0:
|
188 |
-
prev_conclusion_id = f"conclusion-{index-1}"
|
189 |
-
edges.append(StreamlitFlowEdge(f"{prev_conclusion_id}-{situation_id}", prev_conclusion_id, situation_id, animated=True, dashed=True))
|
190 |
-
|
191 |
-
return nodes, edges
|
192 |
|
193 |
-
# ๐ Markdown Preview
|
194 |
def create_markdown_preview(history_df):
|
195 |
markdown = "## ๐ณ Journey Preview\n\n"
|
196 |
for index, row in history_df.iterrows():
|
197 |
indent = " " * (index * 3)
|
198 |
markdown += f"{indent}๐ **{row['situation_name']}** ({row['situation_type']})\n"
|
199 |
-
markdown += f"{indent} ๐ {row['variation']}\n"
|
200 |
markdown += f"{indent} โช {row['action_emoji']} {row['action_name']} ({row['action_type']}): "
|
201 |
markdown += "โ
Success\n" if row['outcome'] else "โ Failure\n"
|
202 |
markdown += f"{indent} ๐ {row['conclusion']}\n"
|
203 |
markdown += f"{indent} ๐ช Gear: {row['gear_strength']:.2f} | ๐๏ธ Skill: {row['rider_skill']:.2f}\n\n"
|
204 |
return markdown
|
205 |
|
206 |
-
# ๐ Game State Management
|
207 |
def update_game_state(game_state, situation, action, outcome, timestamp):
|
|
|
208 |
conclusion = generate_encounter_conclusion(situation, action, outcome)
|
209 |
game_state = update_character_stats(game_state, outcome)
|
210 |
|
@@ -215,7 +81,6 @@ def update_game_state(game_state, situation, action, outcome, timestamp):
|
|
215 |
'situation_name': [situation['name']],
|
216 |
'situation_emoji': [situation['emoji']],
|
217 |
'situation_type': [situation['type']],
|
218 |
-
'variation': [random.choice(situation['variations'])],
|
219 |
'action_id': [action['id']],
|
220 |
'action_name': [action['name']],
|
221 |
'action_emoji': [action['emoji']],
|
@@ -229,13 +94,13 @@ def update_game_state(game_state, situation, action, outcome, timestamp):
|
|
229 |
game_state['history_df'] = pd.concat([game_state['history_df'], new_record], ignore_index=True)
|
230 |
|
231 |
if action['id'] in game_state['history']:
|
232 |
-
game_state['history'][action['id']] += 1
|
233 |
else:
|
234 |
-
game_state['history'][action['id']] = 1
|
235 |
|
236 |
return game_state
|
237 |
|
238 |
-
# ๐ฎ Main Game Application
|
239 |
def main():
|
240 |
st.title("๐ฑ Cat Rider ๐")
|
241 |
st.markdown("""
|
@@ -243,7 +108,7 @@ def main():
|
|
243 |
In this immersive adventure, you will explore the thrilling world of feline riders. This game sets the stage for dramatic situations and guided storytelling with engaging interactive elements.
|
244 |
""")
|
245 |
|
246 |
-
# ๐ Game Rules
|
247 |
st.markdown("""
|
248 |
### ๐ Game Rules
|
249 |
| ๐ค๏ธ Step | ๐ Description |
|
@@ -255,7 +120,7 @@ def main():
|
|
255 |
| 5๏ธโฃ | Complete the Quest and Grow Stronger |
|
256 |
""")
|
257 |
|
258 |
-
# ๐ Initialize game state
|
259 |
if 'game_state' not in st.session_state:
|
260 |
st.session_state.game_state = {
|
261 |
'user_id': str(uuid.uuid4()),
|
@@ -263,10 +128,10 @@ def main():
|
|
263 |
'history': {},
|
264 |
'gear_strength': 5,
|
265 |
'rider_skill': 5,
|
266 |
-
'history_df': pd.DataFrame(columns=['user_id', 'timestamp', 'situation_id', 'situation_name', 'situation_emoji', 'situation_type', '
|
267 |
}
|
268 |
|
269 |
-
# ๐ Game Stats
|
270 |
st.sidebar.markdown("## ๐ Game Stats")
|
271 |
st.sidebar.markdown(f"**Score:** {st.session_state.game_state['score']}")
|
272 |
st.sidebar.markdown(f"**Gear Strength:** {st.session_state.game_state['gear_strength']:.2f}")
|
@@ -278,7 +143,6 @@ def main():
|
|
278 |
|
279 |
st.markdown(f"## {situation['emoji']} Current Situation: {situation['name']} ({situation['type']})")
|
280 |
st.markdown(situation['description'])
|
281 |
-
st.markdown(f"**Specific Challenge:** {random.choice(situation['variations'])}")
|
282 |
st.markdown("### ๐ญ Choose your action:")
|
283 |
|
284 |
cols = st.columns(3)
|
@@ -305,4 +169,39 @@ def main():
|
|
305 |
)
|
306 |
|
307 |
# Display conclusion
|
308 |
-
conclusion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
from streamlit_flow.elements import StreamlitFlowNode, StreamlitFlowEdge
|
9 |
from streamlit_flow.layouts import TreeLayout
|
10 |
|
11 |
+
# ๐ Game World Data (unchanged)
|
12 |
+
SITUATIONS = [ ... ] # Your existing SITUATIONS data
|
13 |
+
ACTIONS = [ ... ] # Your existing ACTIONS data
|
14 |
|
15 |
+
# ๐ฒ Game Mechanics (unchanged)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
def generate_situation():
|
17 |
return random.choice(SITUATIONS)
|
18 |
|
|
|
22 |
def evaluate_action(action, gear_strength, rider_skill, history):
|
23 |
base_success_chance = (gear_strength + rider_skill) / 2
|
24 |
if action['id'] in history:
|
25 |
+
success_chance = base_success_chance + (history[action['id']] * 2)
|
26 |
else:
|
27 |
success_chance = base_success_chance
|
|
|
28 |
outcome = random.randint(1, 100) <= success_chance
|
29 |
return outcome, success_chance
|
30 |
|
31 |
def generate_encounter_conclusion(situation, action, outcome):
|
32 |
+
# Scenario-based conclusions
|
33 |
if outcome:
|
34 |
conclusions = [
|
35 |
+
f"Your {action['name']} was successful! You've overcome the challenges of {situation['name']}. ๐",
|
36 |
+
f"Through clever use of {action['name']}, you've triumphed in the {situation['name']}! ๐",
|
37 |
+
f"Your mastery of {action['name']} led to victory in the {situation['name']}! ๐ช"
|
38 |
]
|
39 |
else:
|
40 |
conclusions = [
|
41 |
+
f"Despite your efforts with {action['name']}, you couldn't overcome the {situation['name']}. ๐",
|
42 |
+
f"Your attempt at {action['name']} wasn't enough in the {situation['name']}. ๐ข",
|
43 |
+
f"The challenges of {situation['name']} proved too great this time. ๐"
|
44 |
]
|
45 |
return random.choice(conclusions)
|
46 |
|
47 |
def update_character_stats(game_state, outcome):
|
48 |
+
# Improve stats only on success
|
49 |
if outcome:
|
50 |
game_state['gear_strength'] = min(10, game_state['gear_strength'] + random.uniform(0.1, 0.5))
|
51 |
game_state['rider_skill'] = min(10, game_state['rider_skill'] + random.uniform(0.1, 0.5))
|
52 |
return game_state
|
53 |
|
54 |
+
# ๐ณ Journey Visualization with Heterogeneous Graph Structure (unchanged)
|
55 |
def create_heterogeneous_graph(history_df):
|
56 |
+
# Your existing node and edge creation logic
|
57 |
+
...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
+
# ๐ Markdown Preview (unchanged)
|
60 |
def create_markdown_preview(history_df):
|
61 |
markdown = "## ๐ณ Journey Preview\n\n"
|
62 |
for index, row in history_df.iterrows():
|
63 |
indent = " " * (index * 3)
|
64 |
markdown += f"{indent}๐ **{row['situation_name']}** ({row['situation_type']})\n"
|
|
|
65 |
markdown += f"{indent} โช {row['action_emoji']} {row['action_name']} ({row['action_type']}): "
|
66 |
markdown += "โ
Success\n" if row['outcome'] else "โ Failure\n"
|
67 |
markdown += f"{indent} ๐ {row['conclusion']}\n"
|
68 |
markdown += f"{indent} ๐ช Gear: {row['gear_strength']:.2f} | ๐๏ธ Skill: {row['rider_skill']:.2f}\n\n"
|
69 |
return markdown
|
70 |
|
71 |
+
# ๐ Game State Management (unchanged)
|
72 |
def update_game_state(game_state, situation, action, outcome, timestamp):
|
73 |
+
# Update based on encounter outcome
|
74 |
conclusion = generate_encounter_conclusion(situation, action, outcome)
|
75 |
game_state = update_character_stats(game_state, outcome)
|
76 |
|
|
|
81 |
'situation_name': [situation['name']],
|
82 |
'situation_emoji': [situation['emoji']],
|
83 |
'situation_type': [situation['type']],
|
|
|
84 |
'action_id': [action['id']],
|
85 |
'action_name': [action['name']],
|
86 |
'action_emoji': [action['emoji']],
|
|
|
94 |
game_state['history_df'] = pd.concat([game_state['history_df'], new_record], ignore_index=True)
|
95 |
|
96 |
if action['id'] in game_state['history']:
|
97 |
+
game_state['history'][action['id']] += 1 if outcome else -1
|
98 |
else:
|
99 |
+
game_state['history'][action['id']] = 1 if outcome else -1
|
100 |
|
101 |
return game_state
|
102 |
|
103 |
+
# ๐ฎ Main Game Application (main logic with improvements)
|
104 |
def main():
|
105 |
st.title("๐ฑ Cat Rider ๐")
|
106 |
st.markdown("""
|
|
|
108 |
In this immersive adventure, you will explore the thrilling world of feline riders. This game sets the stage for dramatic situations and guided storytelling with engaging interactive elements.
|
109 |
""")
|
110 |
|
111 |
+
# ๐ Game Rules (unchanged)
|
112 |
st.markdown("""
|
113 |
### ๐ Game Rules
|
114 |
| ๐ค๏ธ Step | ๐ Description |
|
|
|
120 |
| 5๏ธโฃ | Complete the Quest and Grow Stronger |
|
121 |
""")
|
122 |
|
123 |
+
# ๐ Initialize game state (unchanged)
|
124 |
if 'game_state' not in st.session_state:
|
125 |
st.session_state.game_state = {
|
126 |
'user_id': str(uuid.uuid4()),
|
|
|
128 |
'history': {},
|
129 |
'gear_strength': 5,
|
130 |
'rider_skill': 5,
|
131 |
+
'history_df': pd.DataFrame(columns=['user_id', 'timestamp', 'situation_id', 'situation_name', 'situation_emoji', 'situation_type', 'action_id', 'action_name', 'action_emoji', 'action_type', 'outcome', 'conclusion', 'gear_strength', 'rider_skill', 'score'])
|
132 |
}
|
133 |
|
134 |
+
# ๐ Game Stats (unchanged)
|
135 |
st.sidebar.markdown("## ๐ Game Stats")
|
136 |
st.sidebar.markdown(f"**Score:** {st.session_state.game_state['score']}")
|
137 |
st.sidebar.markdown(f"**Gear Strength:** {st.session_state.game_state['gear_strength']:.2f}")
|
|
|
143 |
|
144 |
st.markdown(f"## {situation['emoji']} Current Situation: {situation['name']} ({situation['type']})")
|
145 |
st.markdown(situation['description'])
|
|
|
146 |
st.markdown("### ๐ญ Choose your action:")
|
147 |
|
148 |
cols = st.columns(3)
|
|
|
169 |
)
|
170 |
|
171 |
# Display conclusion
|
172 |
+
conclusion = st.session_state.game_state['history_df'].iloc[-1]['conclusion']
|
173 |
+
st.markdown(f"**Encounter Conclusion:** {conclusion}")
|
174 |
+
|
175 |
+
# Display updated stats
|
176 |
+
st.markdown(f"**Updated Stats:**")
|
177 |
+
st.markdown(f"๐ช Gear Strength: {st.session_state.game_state['gear_strength']:.2f}")
|
178 |
+
st.markdown(f"๐๏ธ Rider Skill: {st.session_state.game_state['rider_skill']:.2f}")
|
179 |
+
|
180 |
+
# ๐ Display Markdown Preview (unchanged)
|
181 |
+
if not st.session_state.game_state['history_df'].empty:
|
182 |
+
st.markdown(create_markdown_preview(st.session_state.game_state['history_df']))
|
183 |
+
|
184 |
+
# ๐ณ Display Heterogeneous Journey Graph (unchanged)
|
185 |
+
if not st.session_state.game_state['history_df'].empty:
|
186 |
+
st.markdown("## ๐ณ Your Journey (Heterogeneous Graph)")
|
187 |
+
nodes, edges = create_heterogeneous_graph(st.session_state.game_state['history_df'])
|
188 |
+
try:
|
189 |
+
streamlit_flow('cat_rider_flow',
|
190 |
+
nodes,
|
191 |
+
edges,
|
192 |
+
layout=TreeLayout(direction='down'),
|
193 |
+
fit_view=True,
|
194 |
+
height=600)
|
195 |
+
except Exception as e:
|
196 |
+
st.error(f"An error occurred while rendering the journey graph: {str(e)}")
|
197 |
+
st.markdown("Please try refreshing the page if the graph doesn't appear.")
|
198 |
+
|
199 |
+
# ๐ Character Stats Visualization (unchanged)
|
200 |
+
data = {"Stat": ["Gear Strength ๐ก๏ธ", "Rider Skill ๐"],
|
201 |
+
"Value": [st.session_state.game_state['gear_strength'], st.session_state.game_state['rider_skill']]}
|
202 |
+
df = pd.DataFrame(data)
|
203 |
+
fig = px.bar(df, x='Stat', y='Value', title="Cat Rider Stats ๐")
|
204 |
+
st.plotly_chart(fig)
|
205 |
+
|
206 |
+
if __name__ == "__main__":
|
207 |
+
main()
|