Discuss Scratch

maztergamer
Scratcher
23 posts

How to use pen tool to create a line that changes size and length?

How would I be able to create a line with one position for one end and another position for the other end. This is the script I have now but it looks very buggy and flashy:

pen down
repeat until <<not <<mouse down?>>>>
go to x: (xpos) y: (ypos)
go to x: (xpos2) y: (ypos2)
wait (0.0001) secs
clear
end

is there a way to make this much smoother?

(link to project: https://scratch.mit.edu/projects/512467127/)

Last edited by maztergamer (April 7, 2021 19:28:21)

Evanzap
Scratcher
100+ posts

How to use pen tool to create a line that changes size and length?

get rid of the wait thing
maztergamer
Scratcher
23 posts

How to use pen tool to create a line that changes size and length?

get rid of the wait thing
if i get rid of wait it just dissapears
Evanzap
Scratcher
100+ posts

How to use pen tool to create a line that changes size and length?

maztergamer wrote:

get rid of the wait thing
if i get rid of wait it just dissapears
let me go look inside your project and try to fix the issue.
natdilt
Scratcher
100+ posts

How to use pen tool to create a line that changes size and length?

I recommend: 2x2 square
pen down
when [ left] key pressed
change x by (-1)
when [ right] key pressed
change x by (1)
when [ up] key pressed
change y by (1)
when [ left] key pressed
change y by (-1)

Then just you the arrow keys to draw.
To delete, do this

when [ backspace] key pressed
clear
Evanzap
Scratcher
100+ posts

How to use pen tool to create a line that changes size and length?

@maztergamer
I have fixed your issue, put the erase all block like this
pen down
repeat until <not <mouse down>
go to x: (mouse x) y: (mouse y)
clear
go to [Sprite1 v]
wait (0.0001) secs // get rid of this if you want it to be even smoother
end

Last edited by Evanzap (April 7, 2021 19:40:56)

maztergamer
Scratcher
23 posts

How to use pen tool to create a line that changes size and length?

natdilt wrote:

I recommend: 2x2 square
pen down
when [ left] key pressed
change x by (-1)
when [ right] key pressed
change x by (1)
when [ up] key pressed
change y by (1)
when [ left] key pressed
change y by (-1)

Then just you the arrow keys to draw.
To delete, do this

when [ backspace] key pressed
clear
Not exactly looking for a square

The difficulty I'm having is deleting the line and redrawing fast enough that it looks seamless
maztergamer
Scratcher
23 posts

How to use pen tool to create a line that changes size and length?

Evanzap wrote:

@maztergamer
I have fixed your issue, put the erase all block like this
pen down
repeat until <not <mouse down>
go to x: (mouse x) y: (mouse y)
clear
go to [Sprite1 v]
wait (0.0001) secs // get rid of this if you want it to be even smoother
end
that works!
thanks a lot

Powered by DjangoBB