Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
-
import os
|
3 |
|
4 |
-
# HTML content
|
5 |
html_content = """
|
6 |
<!DOCTYPE html>
|
7 |
<html>
|
@@ -408,30 +407,26 @@ html_content = """
|
|
408 |
</html>
|
409 |
"""
|
410 |
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
|
|
|
|
|
|
415 |
|
416 |
-
|
417 |
-
with open("app/index.html", "w") as f:
|
418 |
-
f.write(html_content)
|
419 |
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
css="""
|
434 |
-
.gradio-container {
|
435 |
-
max-width: 850px !important;
|
436 |
-
}
|
437 |
-
#
|
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
+
# The HTML content of the bird shooter game
|
4 |
html_content = """
|
5 |
<!DOCTYPE html>
|
6 |
<html>
|
|
|
407 |
</html>
|
408 |
"""
|
409 |
|
410 |
+
def create_game():
|
411 |
+
return gr.HTML(html_content, height=650)
|
412 |
+
|
413 |
+
# Create Gradio interface
|
414 |
+
with gr.Blocks(title="Bird Shooter Game") as demo:
|
415 |
+
gr.Markdown("# 🎮 Bird Shooter Game")
|
416 |
+
gr.Markdown("Click on the birds to shoot them and score points!")
|
417 |
|
418 |
+
game_interface = create_game()
|
|
|
|
|
419 |
|
420 |
+
gr.Markdown("""
|
421 |
+
## How to Play
|
422 |
+
- Click on birds to shoot them
|
423 |
+
- Each hit earns you 10 points
|
424 |
+
- Try to get the highest score possible!
|
425 |
|
426 |
+
## About
|
427 |
+
This is a simple bird shooter game created with SVG and JavaScript, embedded in a Gradio app for Hugging Face Spaces.
|
428 |
+
""")
|
429 |
+
|
430 |
+
# Launch the app
|
431 |
+
if __name__ == "__main__":
|
432 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|