Sample scenes

Scene examples

Index icon See index
Search Icon

Sample scenes

To get you up and running, and to illustrate what kind of experiences you can build using the SDK, we’ve put together some code and scene examples.

Some of these scenes feature a link to a version of the scene that’s deployed on a remote server. There you can interact with it just as if you were running dcl start locally.

Beginner samples

Static Scene

This is an example of a completely static scene. We’ve laid out a sample space to show off how you can use a layout from blender or a resource like Sketchfab to build your first static Decentraland scene.

Code

Explore the scene

Dynamic Animation

With this Dynamic Animation, we’re demonstrating how to employ simple data binding to objects in your scene. Translation, rotation, and scale are all attributes you can bind to state properties.

Code

Explore the scene

Interactive Content

This simple example shows a scene that you can interact with by opening and closing a door. Clicking the door creates an event, which changes the scene’s state. The scene’s state then changes the rotation of the door, which rotates smoothly thanks to a transition.

Code

Explore the scene

Skeletal Animations

In your scenes, you can load up an interactive GLTF model and trigger its animations. This is an example of how to do that.

Code

Explore the scene

Static XML Scenes

Static XML Scene

This is an example of a completely static scene. It’s built entirely using XML, which makes it easier to write and edit, but doesn’t support any interactions with the user.

Code

Multimedia

Sound Support

This example features sound coming out of an entity, notice how the volume diminishes relative to distance from it. It also includes an animated GLTF object and a floor that randomly changes color.

Code

Explore the scene

Jukebox: Buttons and Sound

This example, that’s described in greater detail in a video tutorial, you operate a jukebox. Each button plays a different song. Buttons are animated, and clicking on one raises any others that were previously clicked.

Code

Explore the scene

Video Support

In this example, you can interact with two video players. One loads the video company into the scene’s assets, the other streams it from an external source. You can also pause, stop and change the volume of the video players.

Code

Explore the scene

Remote Scenes

Multiplayer Content

In this example, based on the door example in the beginner samples, you interact with a door by opening and closing it, while another player is in the same room seeing the door’s state changes. This simple example is built to give you a glimpse into how a multi-user environment works where multiple users interact with the same entities.

Code

Explore the scene

Note: A similar sample is discussed in greater detail in a blogpost.

Tower defense game

This example, that’s described in greater detail in a video tutorial, shows a simple tower defense game. The game generates a random path, and places traps in random locations along that path. Then enemy entities are spawn and follow this path, unless you activate the traps to stop them. The game supports multiple players, has a scoreboard and has a reset button to restart the game at any time.

Code

Explore the scene

Intermediate samples

Dynamic number of entities

In this example, that’s described in greater detail in a blogpost, a new bird appears and starts flying randomly around the scene each time you click on a tree. It’s a good example of how to build multiple entities from an array and of how to handle 3D model animations.

Code

Explore the scene

Memory Game

In this example, that’s described in greater detail in a blogpost, you play with a “Simon Says” game. This game is a good example of how to add more complex logic into a scene and how to change its state based on how the user interacts with it.

Code

Explore the scene

Pay to open

In this example, based on the door example in the beginner samples, you’re only allowed to open the door if you’ve paid 10 MANA to a specific wallet. The sample shows how you can use the SDK to track blockchain transactions.

Code

Advanced samples

Block Dog

In this example, that’s described in greater detail in a video tutorial, you control a pet dog. The dog has its own autonomous actions that it performs randomly. It also follows you around, sits when clicked and goes to drink when you click its bowl.

Code

Explore the scene

Chess game

This example, that’s described in greater detail in a blogpost, takes an existing 2D chess game and builds a 3D scene around it in decentraland. The game can only start when two players have accepted to join the game, and each can only interact with the scene when it’s their turn.

Code

Dog, cat, mouse, cheese

This example, that’s described in greater detail in a video tutorial shows how to build a more complex scene that involves predators and prays, which can interchangeably be mice, cats or dogs. Each animal has a stack-based finite state machine (FSM) to manage its AI. Each animal uses the a* path finding algorithm to find its way around obstacles and other animals.

Code

Explore the scene

×
×

Subscribe

The latest tutorials sent straight to your inbox.

×

Share

Share this tutorial with your community.