Discuss Scratch

PepsiPopsi
Scratcher
5 posts

how to make a boolean block true

i'm having a really hard time with tying to make boolean blocks true. i looked at a few other disscusions and got this:
set [ my varible] to ((1) - (1))
if <key [ space] pressed?> then
jump
end

i'm so clueless!
Dezach
Scratcher
100+ posts

how to make a boolean block true

This should work if your issue is “not jumping when key pressed”:
when green flag clicked
forever
if <key [space v] pressed?> then
jump
end
end

when [space v] key pressed
jump
RapTapWithoutANap
Scratcher
37 posts

how to make a boolean block true

PepsiPopsi wrote:

i'm having a really hard time with tying to make boolean blocks true. i looked at a few other disscusions and got this:
set [ my varible] to ((1) - (1))
if <key [ space] pressed?> then
jump
end

i'm so clueless!
Here's a simple understanding, Boolean variables are variables with 2 states 0 and 1. All the other discussions didn't get it right, a single bit.
Example with jumping :
when green flag clicked
forever
if <touching [sprite ground] ?> then
set [(LOCK)] to [1]
end
end
when green flag clicked
forever
if <key [space] pressed?> then
[The sprite should jump]
end
end
Basiclly it uses set 1 and 2 on the variable and no operators.
RapTapWithoutANap
Scratcher
37 posts

how to make a boolean block true

RapTapWithoutANap wrote:

PepsiPopsi wrote:

i'm having a really hard time with tying to make boolean blocks true. i looked at a few other disscusions and got this:
set [ my varible] to ((1) - (1))
if <key [ space] pressed?> then
jump
end

i'm so clueless!
Here's a simple understanding, Boolean variables are variables with 2 states 0 and 1. All the other discussions didn't get it right, a single bit.
Example with jumping :
when green flag clicked
forever
if <touching [sprite ground] ?> then
set [(LOCK)] to [1]
end
end
when green flag clicked
forever
if <key [space] pressed?> then
[The sprite should jump]
end
end
Basically, it uses set 1 and 2 on the variable and no operators.
Also if the (Player) jumps and the lock if the lock is at 1, and if it's at 0 you can't jump. (Or if lock is at 0 you can jump, and you can't jump if lock is at 1)
Work with the solution
repeat until <Success>
[scratchblocks] Congratulate [/scratchblocks]
end

Powered by DjangoBB