Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -17,6 +17,14 @@ REFRESH_RATE = 5
|
|
17 |
INTERACTION_RADIUS = 2
|
18 |
POINTS_PER_INTERACTION = 1
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
# π¨ Resource Management
|
21 |
@st.cache_resource(show_spinner="Loading game resources...")
|
22 |
def get_game_images():
|
@@ -26,20 +34,6 @@ def get_game_images():
|
|
26 |
'other_player': Image.new('RGB', (50, 50), color='red')
|
27 |
}
|
28 |
|
29 |
-
# π Name Generation
|
30 |
-
@st.cache_data
|
31 |
-
def get_name_components():
|
32 |
-
return {
|
33 |
-
'prefixes': ['Aer', 'Bal', 'Cal', 'Dor', 'El', 'Fae', 'Gor', 'Hel', 'Il', 'Jor',
|
34 |
-
'Kal', 'Lyr', 'Mel', 'Nym', 'Oro', 'Pyr', 'Qar', 'Ryn', 'Syl', 'Tyr'],
|
35 |
-
'suffixes': ['ian', 'or', 'ion', 'us', 'ix', 'ar', 'en', 'yr', 'el', 'an',
|
36 |
-
'is', 'ax', 'on', 'ir', 'ex', 'az', 'er', 'eth', 'ys', 'ix']
|
37 |
-
}
|
38 |
-
|
39 |
-
def generate_fantasy_name():
|
40 |
-
name_parts = get_name_components()
|
41 |
-
return random.choice(name_parts['prefixes']) + random.choice(name_parts['suffixes'])
|
42 |
-
|
43 |
# π Player Synchronization
|
44 |
@st.cache_data(ttl=2)
|
45 |
def load_all_players(timestamp):
|
|
|
17 |
INTERACTION_RADIUS = 2
|
18 |
POINTS_PER_INTERACTION = 1
|
19 |
|
20 |
+
# π Name Generation - Independent function
|
21 |
+
def generate_fantasy_name():
|
22 |
+
prefixes = ['Aer', 'Bal', 'Cal', 'Dor', 'El', 'Fae', 'Gor', 'Hel', 'Il', 'Jor',
|
23 |
+
'Kal', 'Lyr', 'Mel', 'Nym', 'Oro', 'Pyr', 'Qar', 'Ryn', 'Syl', 'Tyr']
|
24 |
+
suffixes = ['ian', 'or', 'ion', 'us', 'ix', 'ar', 'en', 'yr', 'el', 'an',
|
25 |
+
'is', 'ax', 'on', 'ir', 'ex', 'az', 'er', 'eth', 'ys', 'ix']
|
26 |
+
return random.choice(prefixes) + random.choice(suffixes)
|
27 |
+
|
28 |
# π¨ Resource Management
|
29 |
@st.cache_resource(show_spinner="Loading game resources...")
|
30 |
def get_game_images():
|
|
|
34 |
'other_player': Image.new('RGB', (50, 50), color='red')
|
35 |
}
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
# π Player Synchronization
|
38 |
@st.cache_data(ttl=2)
|
39 |
def load_all_players(timestamp):
|