This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-01-08 10:59:00

Robot_Maniac
Scratcher
Registered: 2010-11-22
Posts: 56

Mouse-Clicking

I'm trying to make a painting program, but I want it to activate when I click on my mouse. I tried it, but it just follows my mouse even if I don't click it. Help!


Math Trick of the Week: Choose any three digit number that's one digit is at least 2 less that the tens digit and the tens digit at least 2 less than the hundreds. Then, reverse the digits and subtract. Then, reverse the digits in the answer and add. You should get 1089.

Offline

 

#2 2011-01-08 11:06:21

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: Mouse-Clicking

2 methods:
method 1:{
If mouse down {
goto mouse pointer
pendown
repeat until not mouse down
goto mouse pointer }
pen up}
method 2 :{
goto mouse pointer
if mouse down{
pen down}
else{
pen up }
}

Last edited by poopo (2011-01-08 11:15:29)


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#3 2011-01-08 11:11:13

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Mouse-Clicking

The above post is rather confusing to understand... However poopo is correct, just put this on the sprite that you want to be the pen:

http://img51.imageshack.us/img51/2374/24178354.gif


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

#4 2011-01-08 11:14:49

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: Mouse-Clicking

WeirdF wrote:

The above post is rather confusing to understand... However poopo is correct, just put this on the sprite that you want to be the pen:

http://img51.imageshack.us/img51/2374/24178354.gif

Yes sorry but this would not work smoothly as it would make an unwanted line when going to the mouse pointer so you have to either put the go to mouse pointer above the pen down or out of the ifelse block.  wink


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#5 2011-01-08 11:23:24

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Mouse-Clicking

Yeah... I realised that and so I uploaded a new image, in the hope that nobody would notice my mistake... But looks like you already did!  tongue

So yeah... Here's the better script:

http://img9.imageshack.us/img9/4158/14326512.gif


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

#6 2011-01-08 11:25:42

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: Mouse-Clicking

WeirdF wrote:

Yeah... I realised that and so I uploaded a new image, in the hope that nobody would notice my mistake... But looks like you already did!  tongue

So yeah... Here's the better script:

http://img9.imageshack.us/img9/4158/14326512.gif

Very good. Lol poopo sees all! MWAHAHAHAHAAAAAAAAAAAAAAAAAAAAAAAAAAA


http://i45.tinypic.com/28rnqki.jpg

Offline

 

Board footer