今の天気を調べる gameplay.weatherQuery
ひとことで言うと
今の天気を調べて、その値を返すブロックです。
ブロックとコード
現在の天気
ブロックの文言は公式の日本語版に合わせています(形は簡易表示です)。
gameplay.weatherQuery()gameplay.weather_query()使用例
Check the weather and have your player say a forecast:
JavaScript
player.onChat("forecast", function() {
if (gameplay.weatherQuery() === CLEAR) {
player.say("It's sunny!")
}
else if (gameplay.weatherQuery() === RAIN) {
player.say("It's raining!")
}
else if (gameplay.weatherQuery() === THUNDER) {
player.say("It's a thunderstorm!")
}
});Python
def on_on_chat():
if gameplay.weather_query() == CLEAR:
player.say("It's sunny!")
elif gameplay.weather_query() == RAIN:
player.say("It's raining!")
elif gameplay.weather_query() == THUNDER:
player.say("It's a thunderstorm!")
player.on_chat("forecast", on_on_chat)