Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,10 @@ from streamlit.components.v1 import html
|
|
| 3 |
import random
|
| 4 |
import string
|
| 5 |
|
| 6 |
-
#
|
|
|
|
|
|
|
|
|
|
| 7 |
game_html = """
|
| 8 |
<!DOCTYPE html>
|
| 9 |
<html lang="en">
|
|
@@ -11,12 +14,12 @@ game_html = """
|
|
| 11 |
<meta charset="UTF-8">
|
| 12 |
<title>Galaxxon - Enhanced Arcade Game</title>
|
| 13 |
<style>
|
| 14 |
-
body { margin: 0; overflow: hidden; background: #000; font-family: Arial; }
|
| 15 |
-
canvas { display: block; width:
|
| 16 |
-
#ui { position: absolute; top: 10px; left: 10px; color: white; }
|
| 17 |
-
#sidebar { position: absolute; top: 10px; right: 10px; color: white; width: 200px; background: rgba(0,0,0,0.7); padding: 10px; }
|
| 18 |
-
#lives { position: absolute; top: 40px; left: 10px; color: white; }
|
| 19 |
-
.bonus { position: absolute; color: yellow; font-size: 20px; }
|
| 20 |
</style>
|
| 21 |
</head>
|
| 22 |
<body>
|
|
@@ -361,11 +364,11 @@ game_html = """
|
|
| 361 |
</html>
|
| 362 |
"""
|
| 363 |
|
| 364 |
-
# Streamlit app
|
| 365 |
st.title("Galaxxon - Enhanced Arcade Game")
|
| 366 |
st.write("Use WASD or Arrow Keys to move, Spacebar to shoot. Crash into buildings for bonus points, avoid enemies!")
|
| 367 |
|
| 368 |
-
# Render the HTML game
|
| 369 |
-
html(game_html, height=
|
| 370 |
|
| 371 |
st.write("Note: The game runs in your browser. Ensure you have an internet connection for Three.js to load.")
|
|
|
|
| 3 |
import random
|
| 4 |
import string
|
| 5 |
|
| 6 |
+
# Set Streamlit to wide mode
|
| 7 |
+
st.set_page_config(layout="wide")
|
| 8 |
+
|
| 9 |
+
# Define the enhanced HTML content with Three.js game, full-screen adjustments
|
| 10 |
game_html = """
|
| 11 |
<!DOCTYPE html>
|
| 12 |
<html lang="en">
|
|
|
|
| 14 |
<meta charset="UTF-8">
|
| 15 |
<title>Galaxxon - Enhanced Arcade Game</title>
|
| 16 |
<style>
|
| 17 |
+
html, body { margin: 0; padding: 0; overflow: hidden; background: #000; font-family: Arial; height: 100%; width: 100%; }
|
| 18 |
+
canvas { display: block; width: 100vw !important; height: 100vh !important; }
|
| 19 |
+
#ui { position: absolute; top: 10px; left: 10px; color: white; z-index: 1; }
|
| 20 |
+
#sidebar { position: absolute; top: 10px; right: 10px; color: white; width: 200px; background: rgba(0,0,0,0.7); padding: 10px; z-index: 1; }
|
| 21 |
+
#lives { position: absolute; top: 40px; left: 10px; color: white; z-index: 1; }
|
| 22 |
+
.bonus { position: absolute; color: yellow; font-size: 20px; z-index: 1; }
|
| 23 |
</style>
|
| 24 |
</head>
|
| 25 |
<body>
|
|
|
|
| 364 |
</html>
|
| 365 |
"""
|
| 366 |
|
| 367 |
+
# Streamlit app with minimal UI to maximize game space
|
| 368 |
st.title("Galaxxon - Enhanced Arcade Game")
|
| 369 |
st.write("Use WASD or Arrow Keys to move, Spacebar to shoot. Crash into buildings for bonus points, avoid enemies!")
|
| 370 |
|
| 371 |
+
# Render the HTML game full-screen
|
| 372 |
+
html(game_html, height=1000, width=2000, scrolling=False) # Large values to ensure full coverage
|
| 373 |
|
| 374 |
st.write("Note: The game runs in your browser. Ensure you have an internet connection for Three.js to load.")
|