On my game, I put a script on a blaack line to put in a doorway so that when the main character touches it, it will go to the next room, but it's not working! The script I put on the line is
When green flag clicked
[if]
color <black> is touching color <brown>
broadcast <blubar2room>
[/if]
hide
Is there anything wrong with it?
Last edited by Smileyspongebob (2011-12-28 10:58:08)
Offline
TRocket wrote:
change the script to:
When green flag clicked
wait until <color <black> is touching color <brown>>
broadcast <blubar2room>
hide
Thanks but whats the difference between 'if' and 'wait until'? Just wondering
Offline
Smileyspongebob wrote:
TRocket wrote:
change the script to:
When green flag clicked
wait until <color <black> is touching color <brown>>
broadcast <blubar2room>
hideThanks but whats the difference between 'if' and 'wait until'? Just wondering
wait until stops the rest of the script running until the statment is true(checkss it lots of times) the if block checks it once
Offline
TRocket wrote:
Smileyspongebob wrote:
TRocket wrote:
change the script to:
When green flag clicked
wait until <color <black> is touching color <brown>>
broadcast <blubar2room>
hideThanks but whats the difference between 'if' and 'wait until'? Just wondering
wait until stops the rest of the script running until the statment is true(checkss it lots of times) the if block checks it once
Ohhhh! Thank you SO much!!
Offline
An alternate idea to ensure that you can use the same script would be to encapsulate the "if" block in a forever block. Actually, to get the best performance, put the "wait until" block in a forever block so it checks for it again on the next level.
Offline
Kileymeister_test wrote:
An alternate idea to ensure that you can use the same script would be to encapsulate the "if" block in a forever block. Actually, to get the best performance, put the "wait until" block in a forever block so it checks for it again on the next level.
That's a really good idea! Thanks!
Offline