Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/decentraland-scenes/Block-Fountain
A cube-based fountain that works on Soho Plaza. It includes P2P sync and handling of multiple animations per model.
https://github.com/decentraland-scenes/Block-Fountain
decentraland
Last synced: about 1 month ago
JSON representation
A cube-based fountain that works on Soho Plaza. It includes P2P sync and handling of multiple animations per model.
- Host: GitHub
- URL: https://github.com/decentraland-scenes/Block-Fountain
- Owner: decentraland-scenes
- License: apache-2.0
- Created: 2020-06-22T21:21:00.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-24T21:23:42.000Z (over 2 years ago)
- Last Synced: 2024-05-02T17:52:52.464Z (8 months ago)
- Topics: decentraland
- Language: TypeScript
- Homepage:
- Size: 3.83 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Repository - Block Fountain
README
# Blcok Fountain
A cube-based fountain with multiple animations that uses P2P to sync animations between players.
![](screenshot/screenshot.png)
This scene shows you:
- How to use websockets to sync events between players
- How to handle multiple animations in a same model
- How to keep the scene's code abstracted into various game objects with state and methods of their own
- How to handle random events## Try it out
**Install the CLI**
Download and install the Decentraland CLI by running the following command:
```bash
npm i -g decentraland
```**Previewing the scene**
Download this example and navigate to its directory, then run:
```
$: dcl start
```Any dependencies are installed and then the CLI opens the scene in a new browser tab.
**Scene Usage**
The fountain has four rings of cubes that each behave independently, each ring has three different animations.
If left alone, these animations will be randomly triggered at random intervals. These random events aren't synced between players.
If a player pushes one of the buttons, this will trigger the corresponding animation. The random behavior will stop for a given amount of time, and the animation triggered by the button is synced with all other players in the scene.
You can test this by opening the preview on multiple browser windows. If a player pushes a button on one of these instances, all other players should see the same animation play at the same time.
Learn more about how to build your own scenes in our [documentation](https://docs.decentraland.org/) site.
If something doesn’t work, please [file an issue](https://github.com/decentraland-scenes/Awesome-Repository/issues/new).
## Copyright info
This scene is protected with a standard Apache 2 licence. See the terms and conditions in the [LICENSE](/LICENSE) file.