Spaces:
Sleeping
Sleeping
TANVEERMAKHDOOM
commited on
Commit
•
cd416d2
1
Parent(s):
1554ff4
Update app.py
Browse files
app.py
CHANGED
@@ -1,27 +1,27 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
# Define the function that generates the game design document
|
4 |
-
def generate_document(game_environments, protagonist, antagonist):
|
5 |
return (
|
6 |
f"**Game Environments:**\n{game_environments}\n\n"
|
7 |
f"**Protagonist:**\n{protagonist}\n\n"
|
8 |
f"**Antagonist:**\n{antagonist}\n\n"
|
9 |
-
f"**Game Story:**\n"
|
10 |
-
"To be added based on the environments, protagonist, and antagonist."
|
11 |
)
|
12 |
|
13 |
# Streamlit app
|
14 |
def main():
|
15 |
st.title("StoryForge")
|
16 |
-
|
17 |
st.write(
|
18 |
"StoryForge is your ultimate companion for crafting comprehensive game design documents. "
|
19 |
"By providing structured inputs about game environments, protagonists, and antagonists, "
|
20 |
"StoryForge helps you organize your ideas into a clear and cohesive design document."
|
21 |
)
|
22 |
-
|
23 |
st.header("Input Details")
|
24 |
-
|
|
|
25 |
game_environments = st.text_area(
|
26 |
"Game Environments",
|
27 |
"Enter the different settings or worlds where the game takes place."
|
@@ -37,14 +37,35 @@ def main():
|
|
37 |
"Detail the main antagonist of the game."
|
38 |
)
|
39 |
|
|
|
|
|
|
|
|
|
|
|
40 |
if st.button("Generate Document"):
|
41 |
-
if game_environments and protagonist and antagonist:
|
42 |
-
document = generate_document(game_environments, protagonist, antagonist)
|
43 |
st.subheader("Generated Game Design Document")
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
else:
|
46 |
st.error("Please fill out all fields.")
|
47 |
|
48 |
if __name__ == "__main__":
|
49 |
main()
|
50 |
|
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
# Define the function that generates the game design document
|
4 |
+
def generate_document(game_environments, protagonist, antagonist, game_story):
|
5 |
return (
|
6 |
f"**Game Environments:**\n{game_environments}\n\n"
|
7 |
f"**Protagonist:**\n{protagonist}\n\n"
|
8 |
f"**Antagonist:**\n{antagonist}\n\n"
|
9 |
+
f"**Game Story:**\n{game_story}"
|
|
|
10 |
)
|
11 |
|
12 |
# Streamlit app
|
13 |
def main():
|
14 |
st.title("StoryForge")
|
15 |
+
|
16 |
st.write(
|
17 |
"StoryForge is your ultimate companion for crafting comprehensive game design documents. "
|
18 |
"By providing structured inputs about game environments, protagonists, and antagonists, "
|
19 |
"StoryForge helps you organize your ideas into a clear and cohesive design document."
|
20 |
)
|
21 |
+
|
22 |
st.header("Input Details")
|
23 |
+
|
24 |
+
# Input fields for the user
|
25 |
game_environments = st.text_area(
|
26 |
"Game Environments",
|
27 |
"Enter the different settings or worlds where the game takes place."
|
|
|
37 |
"Detail the main antagonist of the game."
|
38 |
)
|
39 |
|
40 |
+
game_story = st.text_area(
|
41 |
+
"Game Story",
|
42 |
+
"Provide an overview of the game's narrative arc."
|
43 |
+
)
|
44 |
+
|
45 |
if st.button("Generate Document"):
|
46 |
+
if game_environments and protagonist and antagonist and game_story:
|
47 |
+
document = generate_document(game_environments, protagonist, antagonist, game_story)
|
48 |
st.subheader("Generated Game Design Document")
|
49 |
+
|
50 |
+
# Two-column layout
|
51 |
+
col1, col2 = st.columns(2)
|
52 |
+
|
53 |
+
with col1:
|
54 |
+
st.write("**Game Environments:**")
|
55 |
+
st.write(game_environments)
|
56 |
+
st.write("**Protagonist:**")
|
57 |
+
st.write(protagonist)
|
58 |
+
|
59 |
+
with col2:
|
60 |
+
st.write("**Antagonist:**")
|
61 |
+
st.write(antagonist)
|
62 |
+
st.write("**Game Story:**")
|
63 |
+
st.write(game_story)
|
64 |
+
|
65 |
else:
|
66 |
st.error("Please fill out all fields.")
|
67 |
|
68 |
if __name__ == "__main__":
|
69 |
main()
|
70 |
|
71 |
+
|