Sound On/Off Button

Материал из Поле цифровой дидактики
Версия от 11:33, 21 июля 2022; Patarakin (обсуждение | вклад) (1 версия импортирована)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)

Шаблон:Expand Шаблон:Warning

A sound on/off button may be useful when making a game that has music or sound that can be muted or stopped.

To make a sound on/off button, one will need a sprite in the form of a switch. The switch must provide two costumes, one to represent when sound is on, and the other to represent when sound is off.

whenclickedswitchcostumetosound-onwhenthisspriteclickednextcostumeifcostumenumber=2thenassumingthesecondcostumeis"off"andthefirst"on"setvolumeto0%ifnowoff,turnoffthevolumeelsesetvolumeto100%ifnowon,turnonthevolumeend

This script can be modified to allow the Шаблон:Val to be changed.

Шаблон:Note

See Also

References

<references/>