i made a variable called "settings" and when settings = 1 when mouse-pointer is over sprite1 it gives one sound, when setting = 2 when mouse-pointer is over sprite1 it should give sound2.
right now sound2 does work in setting = 2 but sound1 still sounds in setting = 2 which i don't want it to.
what to do?
thnxxx
Offline
sprite1:
when space key pressed
if settings = 1
forever if touching mouse-pointer
play sound sound1 until done
when i recive yes
if settings = 2
forever if touching mouse-pointer
play sound sound2 until done
sprite2:
when space key pressed
forever set settings to 1
when sprite2 clicked
broadcast yes
forever
set settings to 2
set settings to settings mod 2 + 1
also, what does the mod thing actually do? i got help with that one, just great to know why it's there
Offline
arvidabystrom wrote:
sprite1:
when [space v] key pressed if <(settings) = (1)> forever if <touching [mouse-pointer v]?> play sound [sound1 v] until done when i receive [yes v] if <(settings) = (2)> forever if <touching [mouse-pointer v]?> play sound [sound2 v] until donesprite2:when [space v] key pressed set [settings v] to (1) when [sprite2] clicked broadcast [yes v] set [settings v] to (2) set [settings v] to ((settings) mod ((2) + (1)))also, what does the mod thing actually do? i got help with that one, just great to know why it's there
Fixed scratchblocks.
Offline
arvidabystrom wrote:
sprite1:
when space key pressed
if settings = 1
forever if touching mouse-pointer
play sound sound1 until done
when i recive yes
if settings = 2
forever if touching mouse-pointer
play sound sound2 until done
sprite2:
when space key pressed
forever set settings to 1
when sprite2 clicked
broadcast yes
forever
set settings to 2
set settings to settings mod 2 + 1
also, what does the mod thing actually do? i got help with that one, just great to know why it's there
The mod operator divides the first number by the second number and gives you the remainder. For example:
(4) mod (4) = 0
(7) mod (4) = 3
I hope that this answers your second question!
Offline
jontmy00 wrote:
arvidabystrom wrote:
sprite1:
when [space v] key pressed if <(settings) = (1)> forever if <touching [mouse-pointer v]?> play sound [sound1 v] until done when i receive [yes v] if <(settings) = (2)> forever if <touching [mouse-pointer v]?> play sound [sound2 v] until donesprite2:when [space v] key pressed set [settings v] to (1) when [sprite2] clicked broadcast [yes v] set [settings v] to (2) set [settings v] to ((settings) mod ((2) + (1)))also, what does the mod thing actually do? i got help with that one, just great to know why it's thereFixed scratchblocks.
"Set [settings v] to ((settings) mod (3))"?
What that for?
Offline