March 14, 2025

How to Use Rosebud's Multi-File Template

Create 3D games without coding skills!
CREATE NOW

Building a 3D experience with Three.js and React?

Our multi-file structure is a solid starting point. It's designed to be modular, easy to extend, and fully compatible with AI-powered interactions.

But how does it work, and how can you customize it?

As your project grows, you can help Rosie stay focused by selecting which files to include in each prompt. Just click on “Code” in the editor, then uncheck any files that aren’t relevant by clicking the purple dots next to each filename.

This keeps things lightweight and ensures Rosie edits exactly what you intend—no surprises.

👉 Remix the Multi-File Template Here

How AI Edits Work

Every time you request a change (like “Add a rotating sphere” or “Change the background color”), Rosie analyzes your prompt and generates the exact code edits needed.

You can then apply these edits directly to your project.

Here’s the process:

  1. You describe the modification you want.
  2. Rosie determines what changes need to be made to the existing files.
  3. It generates the code.
  4. The changes are applied to your project.

Rosie doesn’t just modify existing files—she creates new ones when needed.

This means that while the template starts with four key files, your project will expand dynamically as Rosie builds out your vision. Her ability to manage and generate new files makes the AI-assisted coding process incredibly powerful and flexible.

Understanding the Multi-File Structure

This template is structured into four key files, but remember—Rosie will create more files as needed to complete your project.

  • main.js – The entry point that initializes your React app and renders the App component.
  • App.js – The main UI component that structures your interface and mounts the 3D scene.
  • ThreeScene.js – Handles all Three.js-related functionality, including rendering a rotating cube.
  • ChatAIClass.js – Provides optional AI chat functionality powered by Rosebud AI, allowing in-game interactions.

As you continue modifying your project, Rosie will expand this structure automatically, creating additional files to keep your project well-organized and scalable.

Choosing Which Files to Modify

As your project grows, Rosie may need a bit of guidance to know exactly where to apply your changes.

This is because AI models—like the one powering Rosie—can only process a limited number of lines of code at once. It’s a technical limitation shared by all current LLMs, not just Rosebud.

Think of it like this: AI models work kind of like very fast, very smart guessers—they read your prompt and try to predict what to write next, one step at a time.

But they can only “keep in mind” a limited amount of information at once. When a project gets big, it’s like trying to write a novel while only being able to see a few pages at a time.

That’s why Rosie sometimes needs your help focusing on the right files—so she doesn’t get overwhelmed or go off track.

To help Rosie focus on the right files, you can manually select which files to include in each prompt. Just click on “Code” in the editor and uncheck any files that aren’t relevant to your prompt by clicking the purple dots next to each filename.

This keeps things lightweight and ensures Rosie is editing exactly what you intend.

We know this step adds a bit of friction, and we’re already working on smarter, more automated file selection in the future. But for now, a little manual curation can go a long way in getting the best results from your AI assistant.

How to Customize This Template

🎨 Modify 3D Elements in ThreeScene.js:

  • Change 3D objects, geometry, or materials.
  • Adjust camera settings, lighting, or animations.
  • Add interactivity (e.g., user-controlled movement or AI-driven object behavior).

🖥️ Customize the UI in App.js:

  • Change the UI layout or add new UI components.
  • Introduce controls that interact with the 3D scene.
  • Adjust styling to match your game or application’s theme.

🔧 Use New Components If:

  • You need reusable UI elements (buttons, menus, HUDs, etc.).
  • A feature is complex enough to deserve its own module.
  • You want to keep things organized and scalable.

🤖 Edit ChatAIClass.js for AI Features:

  • You want to add AI-powered chat or interactions.
  • Your 3D objects should respond to natural language commands.
  • You’re building an interactive NPC or virtual assistant.

Get Started with Your Own Project

This template gives you a solid foundation to start building a React + Three.js application with AI capabilities.

Whether you’re making a 3D game, a visualization tool, or an interactive AI experience, modular structure is key to making it scalable and easy to manage.

Remix this template in Rosebud AI and start customizing it to fit your vision!

Turn your ideas into games, apps, and websites!
GET STARTED NOW