TANVEERMAKHDOOM commited on
Commit
5b61aa1
1 Parent(s): 04ed98a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -0
app.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def generate_game_design(environment, protagonist, antagonist):
4
+ # Here you would add logic to generate game design based on inputs.
5
+ game_story = f"In a {environment}, a {protagonist} faces off against a {antagonist}."
6
+ return environment, protagonist, antagonist, game_story
7
+
8
+ def main():
9
+ with gr.Blocks() as demo:
10
+ gr.Markdown("# StoryForge\nA tool to help you generate engaging game design ideas.")
11
+
12
+ with gr.Row():
13
+ with gr.Column():
14
+ gr.Markdown("## Game Development")
15
+ environment = gr.Textbox(label="Game Environment", placeholder="e.g., a post-apocalyptic city")
16
+ protagonist = gr.Textbox(label="Protagonist", placeholder="e.g., a young warrior with a mysterious past")
17
+ antagonist = gr.Textbox(label="Antagonist", placeholder="e.g., a dark sorcerer seeking to conquer the world")
18
+ submit_btn = gr.Button("Generate Game Design")
19
+
20
+ with gr.Column():
21
+ gr.Markdown("## Protagonist")
22
+ gr.Markdown("## Antagonist")
23
+ gr.Markdown("## Game Story")
24
+ game_story_output = gr.Textbox(label="Game Story", interactive=False)
25
+
26
+ submit_btn.click(generate_game_design, inputs=[environment, protagonist, antagonist], outputs=game_story_output)
27
+
28
+ demo.launch()
29
+
30
+ if __name__ == "__main__":
31
+ main()