Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/decentraland-scenes/Weather-simulation
A scene that checks a weather API for the weather in a location and displays that weather condition, showing rain, thunder or snowflakes Use real weather data from different locations by changing the coordinates, or change the value of the “fakeWeather” variable to see different weather conditions manifest.
https://github.com/decentraland-scenes/Weather-simulation
decentraland
Last synced: 3 months ago
JSON representation
A scene that checks a weather API for the weather in a location and displays that weather condition, showing rain, thunder or snowflakes Use real weather data from different locations by changing the coordinates, or change the value of the “fakeWeather” variable to see different weather conditions manifest.
- Host: GitHub
- URL: https://github.com/decentraland-scenes/Weather-simulation
- Owner: decentraland-scenes
- License: apache-2.0
- Created: 2019-01-06T16:41:43.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T12:27:06.000Z (over 1 year ago)
- Last Synced: 2024-05-02T17:52:52.201Z (10 months ago)
- Topics: decentraland
- Language: TypeScript
- Homepage:
- Size: 2.55 MB
- Stars: 8
- Watchers: 4
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Repository - Weather Simulation
README
## Weather API
A scene that checks a weather API for the weather in a location and displays that weather condition, showing rain, thunder or snowflakes
Use real weather data from different locations by changing the coordinates, or change the value of the “fakeWeather” variable to see different weather conditions manifest.
This scene shows you:
- How to call a REST API and parse a JSON response
- How to conditionally render different scenarios based on the API's responses
- How to simulate rain by moving multiple entities down and recycling them
- How to sumulate snow by slowly moving arnd rotating multiple entities down and recyling them## 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**
You need create an account on the the [Weather Unlocked API](http://www.weatherunlocked.com/products/weather-api/overview). Then, replace the values of the fields `appId` and `APIkey` with your own credentials.
You can also replace the values of `lat` and `lon` to access weather data from a different location. By default they're set to point to the city of Buenos Aires.
Modify the value of `fakeWeather` to see different weather conditions independently of what the real weather is. For example, if you set it to "snow" you will see snow. If `fakeWeather = null`, the scene will call the weather API with your credentials.
You can also modify `dropSpeed` and `flakeSpeed` to change the speed at which raindrops or snowflakes fall. This speed is the amount of milliseconds it takes them to fall.
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.