Game Elements tutorial
A broad overview on how to use Game Elements in the BetterVoxel Editor.
Creating and Managing Game Elements
This tutorial will walk you through the different game elements you can create and manage within the editor, and how to use the Workspace and Inspector tabs to interact with them.
Game Elements Overview
Part
A Part is a simple box-shaped object with physical collisions and a customizable color. It is a basic building block for creating structures and environments.
Folder
A Folder is used to group several game objects, allowing for easier management of complex workspaces. You can drag and drop objects into folders to keep your project organized.
SpotLight
A SpotLight is a directional light source with rays spread over a cone shape. It behaves similarly to a flashlight, illuminating a specific area.
PointLight
A PointLight is a spherical light source that emits light in all directions, similar to the sun or a light bulb.
Script
A Script element allows you to add Lua scripting to your game. You can control, interact with, and manipulate other game objects, as well as access engine APIs to add custom logic.
PlayerPrefab
The PlayerPrefab represents the player within the game. This prefab is a placeholder for more complex player objects you may design in the future.
Creating a New Game Element
To create a new game element in the BetterVoxel Editor, follow these steps:
- Top Bar:
- Navigate to the top bar of the editor. You will find buttons for each game element type: Part, Folder, SpotLight, PointLight, Script, and PlayerPrefab.
- Click on the desired game element type to create it.
- Inspector Tab:
- Alternatively, you can open the Inspector tab.
- Within the inspector, locate the Create Entity button.
Managing Game Elements in the Workspace
After creating a new game element, it will automatically appear in the Workspace hierarchy. The Workspace tab displays all game elements in a tree structure, allowing you to:
- Select an element by clicking on it.
- Group objects by dragging them into Folders.
- Rearrange elements for better organization.
The Workspace provides a clear overview of your entire game project.
Using the Inspector to Modify Game Elements
When you select a game element in the Workspace, its metadata will be displayed in the Inspector tab. The Inspector allows you to view and modify the details of each element.
For example:
- Part: You can modify the size, color, and scale.
- SpotLight: You can change the outer angle, intensity, and range.
- Script: You can edit the Lua script associated with the game element.
The changes should be applied immediatly in the Game View of the project.
Summary
In the BetterVoxel Editor, creating and managing game elements is straightforward:
- Create new elements via the Top Bar or the Inspector's Create Entity button.
- View and organize elements in the Workspace hierarchy.
- Edit element details and metadata in the Inspector.
Experiment with these tools to create, modify, and organize your game world!