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

#1 2007-05-16 17:05:09

weissjd
Scratcher
Registered: 2007-05-16
Posts: 64

Mouse down pauses execution?

I have a simple script that has a sprite follow the mouse, then should continously stamp if the mouse button is down. It looks like this:

When [green flag] clicked
Clear
Forever
  Go to Mouse X, Mouse Y
  If Mouse Down
    Stamp
  End
End

I would expect this to create trails of my sprite on the stage if I click and drag the mouse. However, this only seems to work some of the time. It seems like if I'm already moving the mouse when I click the mouse button it works as expected.

However, if I'm not moving the mouse or only moving it a little, it stamps once or twice but then stops. If I step through it looks like everything just pauses shortly after I click the mouse button unless I was already moving the mouse, then it works as expected. As soon as I release the mouse button it continues processing.

This is in Scratch 1.1 in Windows. Any ideas?

Thanks,

Josh

Offline

 

#2 2007-05-18 18:50:09

johnm
Scratcher
Registered: 2007-03-08
Posts: 100+

Re: Mouse down pauses execution?

Hi, Josh.

I suspect what's happening is that you are actually picking up the sprite and dragging it. When you are dragging a sprite, it's scripts don't run.  Your script should work the way you expect in presentation mode and in the Java player.

  -- John

Last edited by johnm (2007-05-18 18:50:50)

Offline

 

#3 2007-05-19 07:18:02

weissjd
Scratcher
Registered: 2007-05-16
Posts: 64

Re: Mouse down pauses execution?

John,

Thanks, that was it. It would be nice if it didn't drag when scripts were running or if there were a way to turn it off. Presentation mode is really ugly since everything gets blown up.

Anyway, thanks a lot for the heads up.

Josh

Last edited by weissjd (2007-05-19 07:23:29)

Offline

 

Board footer