I need help with a part of my project

I need help with a drawing tyoe project that I am working on where I need it to where if you click once it starts but when you click again it stops

On this situation, your normally have a variable that holds the state of whether your stopped or running

Then in your on click script, you check the variable and act accordingly.

Don't forget to update the variable when you are stopped or running

Here's my Script (Works in Scratch too):
OptionChanger Template script pic
Here's my code: Snap! Build Your Own Blocks

I always used this Script in Scratch because there was no "TRUE" or "FALSE" block

thanks @cymplecy

and @slate_technologies

but why can't you just use the true/false block

here is my project Snap! 6.9.2 Build Your Own Blocks as you can see my code is all depending on as soon as the mouse is clicked

but I need it to be where if it is clicked again the sprite that draws needs to stop moving

that is what I need help with

sorry I was not being clear as to what I was saying in my first comment

Please don’t post multiple times to add to your previous ones. Click the pencil icon and edit one of them.

Like I said, the algorithm/script works with Scratch.

I used this script for Scratch projects as they didn't have True/False blocks.

Always happy to help!

But you're in Snap!, where there are true/false blocks. So... why don't you just use the true/false blocks?

but the thing is im not talking about when somehting is clicked but instead im talking about when the screen is clicked because im trying to make a drawing game so when the screen is clicked again then it stops drawing or stops in its place

[scratchblocks]
when <mouse down?> :: control hat
set [var v] to <not (var)>
when green flag clicked
forever
if (var) then
Your code here :: grey
end
end
[/scratchblocks]

is this better? (Snap! Build Your Own Blocks)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.