Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Creating Boolean Blocks
- Attolia
-
2 posts
Creating Boolean Blocks
I've read the articles about Boolean blocks and creating blocks on the wiki and, although I understand them in theory, I haven't had much success with translating that theory into practice.
The second sprite here - https://scratch.mit.edu/projects/140124596/ - contains my attempt at creating a boolean, and also what I'm trying to do with it (the create block script and the two others that have separated from their events).
I would really appreciate it if someone would be able to tell me why it isn't working - am I missing something? am I not using it as it should be used? - and help me correct it or point me towards another route.
This is my first project and I am sure that it is an utter mess. My apologies if it's difficult to navigate.
The second sprite here - https://scratch.mit.edu/projects/140124596/ - contains my attempt at creating a boolean, and also what I'm trying to do with it (the create block script and the two others that have separated from their events).
I would really appreciate it if someone would be able to tell me why it isn't working - am I missing something? am I not using it as it should be used? - and help me correct it or point me towards another route.
This is my first project and I am sure that it is an utter mess. My apologies if it's difficult to navigate.
- Despicable_Dad
-
500+ posts
Creating Boolean Blocks
Seems to work perfectly. :-/
EDIT: Good game idea BTW.
EDIT: Good game idea BTW.
Last edited by Despicable_Dad (Jan. 17, 2017 22:30:59)
- stickfiregames
-
1000+ posts
Creating Boolean Blocks
You can't create custom booleans. What you are trying to use are boolean inputs for custom blocks, which are meant to be used in the define script - here is an example (it's not a block anyone would actually make, but still):
define if <boolean> say (string)If you use a custom boolean input outside a define script it will just return false.
if <boolean> then
say (string)
end
if <> say [] // the block that this define script makes
- Attolia
-
2 posts
Creating Boolean Blocks
Thanks very much, both the remix and the example have been very helpful! I comprehend it a lot better now, and feel like I can actually make it work.
The remix is elegant and very educational.
And yes it does work, but the speed of the mouse increases exponentially with each level with the intention of preventing it blowing straight past difficult into straight-out impossible too quickly, but it ended up plateauing instead. So I thought that about when it started plateauing I could start slowing the crab down, which might not be as straight forward as re-jigging the mouse but had the advantage of a new puzzle to solve.
Thanks again
The remix is elegant and very educational.
And yes it does work, but the speed of the mouse increases exponentially with each level with the intention of preventing it blowing straight past difficult into straight-out impossible too quickly, but it ended up plateauing instead. So I thought that about when it started plateauing I could start slowing the crab down, which might not be as straight forward as re-jigging the mouse but had the advantage of a new puzzle to solve.
Thanks again

- benbat2010
-
23 posts
Creating Boolean Blocks
How do I
use the boolean block on scratch
define bolean
- LPYsilvio
-
4 posts
Creating Boolean Blocks
you have to press a new boolean and drag a sense block like mouse down, and then just if boolean then say so drag forvever and put over new block and if you mouse down boolean and say …
- Joasoa
-
52 posts
Creating Boolean Blocks
you have to press a new boolean and drag a sense block like mouse down, and then just if boolean then say so drag forever and put over new block and if you mouse down boolean and say…
<key [d v] pressed?> - (<key [a v] pressed?> * (-1)) //Useful for x movement, because returns 1 if d, 0 if both or none and -1 if a
- Discussion Forums
- » Help with Scripts
-
» Creating Boolean Blocks