awacke1 commited on
Commit
0c5342d
·
verified ·
1 Parent(s): 5a67dc5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -157,10 +157,13 @@ def main():
157
  current_time = time.time()
158
  for crop_type, plant_times in game_data[player_name]["crops"].items():
159
  for plant_time in plant_times:
160
- growth_progress = min(100, ((current_time - plant_time) / game.crops[crop_type]["growth_time"]) * 100)
 
161
  st.progress(growth_progress)
162
- st.write(f"{game.crops[crop_type]['emoji']} {crop_type}: {growth_progress:.1f}% grown")
163
-
 
 
164
  with col4:
165
  st.write("Harvest Ready Crops:")
166
  for crop_type in game.crops:
 
157
  current_time = time.time()
158
  for crop_type, plant_times in game_data[player_name]["crops"].items():
159
  for plant_time in plant_times:
160
+ # Convert progress to 0-1 range instead of 0-100
161
+ growth_progress = min(1.0, (current_time - plant_time) / game.crops[crop_type]["growth_time"])
162
  st.progress(growth_progress)
163
+ # Display percentage for user (0-100)
164
+ progress_percent = growth_progress * 100
165
+ st.write(f"{game.crops[crop_type]['emoji']} {crop_type}: {progress_percent:.1f}% grown")
166
+
167
  with col4:
168
  st.write("Harvest Ready Crops:")
169
  for crop_type in game.crops: