Imagine typing a game idea like “make a snake game” and instantly getting playable JavaScript code. Sounds like magic? With FlowHunt, it’s entirely possible! In this guide, we’ll walk you step-by-step through building a specific FlowHunt flow, using components like the Tool Calling Agent and a dedicated Prompt node, to create your own AI assistant that generates JavaScript mini-games on demand. Let’s build this fun tool together!
https://astoragames.com/games/tic-tac-toe
The Flow We’ll Build:
Here’s the structure we’ll be implementing, designed for clarity and utilizing specific FlowHunt components:

Step 1: Create a New Flow & Add Components
Let’s start by setting up our canvas and adding all the necessary building blocks shown in the diagram.
In your FlowHunt dashboard, navigate to My Flows and click Create Flow. Name it something like “AI JS Game Generator v2”.

Drag the following components onto your canvas from the component library:
- Chat Input
- Chat History (using InMemoryChatMessageHistory)
- LLM Anthropic AI (or your preferred LLM node like LLM OpenAI, LLM Gemini)
- Prompt
- URL Retriever
- Google Search
- Tool Calling Agent
- Chat Output
Step 2: Configure the Core Components
Now, let’s set up the key nodes that handle the logic.
- Prompt Node:
- Click the Prompt node.This node formats the instructions for the AI. In the Template field, enter the detailed instructions, using template variables if needed (like {{$input}} to refer to the message from Chat Input).Paste the following prompt template:
—GAME TO BE GENERATED—
{input}
—EXAMPLE OF JAVASCRIPT FILE—
*java file*—
—ALREADY CREATED HTML FILE—
*HTML file*— - Adding Tools To Tool Calling Agent (URL Retriever, Google Search):
- While included in this flow diagram and connected to the Tool Calling Agent, these tools might not be strictly necessary for the basic task of generating a game from a description.
- Connecting them makes them available to the agent. If the AI (based on its core LLM and prompt) decides it needs to search the web or fetch content from a URL to fulfill the request, it can use these tools. For simple requests like “make a pong game”, it likely won’t need them. No specific configuration is needed here unless you have API keys for Google Search.
Step 3: Connect the Components
Wire the nodes together precisely as shown in the diagram. This ensures data flows correctly.
- Chat History (InMemoryChatMessageHistory output) -> Tool Calling Agent (Chat History input).
- LLM Anthropic AI (LLM output) -> Tool Calling Agent (LLM input).
- Chat Input (Message output) -> Prompt (Input input).
- Prompt (Message output) -> Tool Calling Agent (Inputs* input – Note the asterisk, often indicating the primary user/prompt input).
- URL Retriever (Documents As Tool output) -> Tool Calling Agent (Tools* input – This input accepts multiple tool connections).
- Google Search (Google Search as Tool output) -> Tool Calling Agent (Tools* input).
- Tool Calling Agent (Message output) -> Chat Output (Text* input).

Step 4: Generate Your JavaScript Mini-Game
Let’s bring your game ideas to life!
- Save your flow, then click the AI button (▶️).
- In the chat panel, type your game request (e.g., Make Tetris).
[Image: Screenshot of the chat interface with a user entering a game prompt] - Press Enter. The Prompt node will format your request, and the Tool Calling Agent, using the LLM Anthropic AI, will generate the game code.
Step 5: Play Your AI-Generated Game
- Copy the entire code block from the Chat Output.
- Paste it into a plain text editor (Notepad, TextEdit, VS Code).
- Save the file with an .html extension (e.g., ai_tetris.html).
- Double-click the saved file to open it in your web browser and play!
Conclusion: Building Specific AI Flows with FlowHunt
By following this specific flow diagram, you’ve built a powerful AI JavaScript game generator using FlowHunt. This example demonstrates how to combine dedicated LLM and Prompt nodes with the versatile Tool Calling Agent, even making external tools like web search available if needed. FlowHunt’s visual interface makes building and understanding even these slightly more complex AI workflows straightforward and efficient. Happy game generating!
Get started with your first flow
Flowhunt has a team of AI flow engineers ready to help you with AI Automation.