Spaces:
Sleeping
Sleeping
import streamlit as st | |
# Define the function that generates the game design document | |
def generate_document(game_environments, protagonist, antagonist, game_story): | |
return ( | |
f"**Game Environments:**\n{game_environments}\n\n" | |
f"**Protagonist:**\n{protagonist}\n\n" | |
f"**Antagonist:**\n{antagonist}\n\n" | |
f"**Game Story:**\n{game_story}" | |
) | |
# Streamlit app | |
def main(): | |
st.title("StoryForge") | |
st.write( | |
"StoryForge is your ultimate companion for crafting comprehensive game design documents. " | |
"By providing structured inputs about game environments, protagonists, and antagonists, " | |
"StoryForge helps you organize your ideas into a clear and cohesive design document." | |
) | |
st.header("Input Details") | |
# Input fields for the user | |
game_environments = st.text_area( | |
"Game Environments", | |
"Enter the different settings or worlds where the game takes place." | |
) | |
protagonist = st.text_area( | |
"Protagonist", | |
"Describe the main character of the game." | |
) | |
antagonist = st.text_area( | |
"Antagonist", | |
"Detail the main antagonist of the game." | |
) | |
game_story = st.text_area( | |
"Game Story", | |
"Provide an overview of the game's narrative arc." | |
) | |
if st.button("Generate Document"): | |
if game_environments and protagonist and antagonist and game_story: | |
document = generate_document(game_environments, protagonist, antagonist, game_story) | |
st.subheader("Generated Game Design Document") | |
# Two-column layout | |
col1, col2 = st.columns(2) | |
with col1: | |
st.write("**Game Environments:**") | |
st.write(game_environments) | |
st.write("**Protagonist:**") | |
st.write(protagonist) | |
with col2: | |
st.write("**Antagonist:**") | |
st.write(antagonist) | |
st.write("**Game Story:**") | |
st.write(game_story) | |
else: | |
st.error("Please fill out all fields.") | |
if __name__ == "__main__": | |
main() | |