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

#1 2011-06-21 17:27:20

frizzlepuss893
Scratcher
Registered: 2011-06-10
Posts: 100+

i need a script for a program i'm making

i need a script so that when you click one of the sprites at the bottom, an excact copy appears on your mouse and its on your mouse-pointer until you click on the spot where you wanna put it and it goes there and stays there so you can click another sprite and that same thing happens.


"Wait, what?"-Frizzlepuss. Jumpathon 5! play now!
The scratch song! Congratulations scratch! 2 million projects!

Offline

 

#2 2011-06-21 17:33:39

ASD8
New Scratcher
Registered: 2011-06-21
Posts: 15

Re: i need a script for a program i'm making

unfortunately, scratch is not class based so you cannot do this. you could, however, make this sort of work by making a bunch of the same sprite. i would post an example script but i'm busy.

Offline

 

#3 2011-06-21 17:37:09

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: i need a script for a program i'm making

Something like this should do the trick, just replace x: 0 y: 0 with whatever you want the position to be.

http://i.imgur.com/6tA8d.gif

The disadvantage is that the images you place are static, but this is simple and only uses one sprite.

Last edited by Harakou (2011-06-21 17:38:06)


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#4 2011-06-21 17:42:17

frizzlepuss893
Scratcher
Registered: 2011-06-10
Posts: 100+

Re: i need a script for a program i'm making

no i mean like house builder 2.0 or something like that. so i dont have to make a bunch of sprites and crowd them around in a box. like a script that makes it stamp once or something and then so you have to hold the mouse until you find the right spot then let go of the mouse to make it stop there. something like that... er, i dont know!


"Wait, what?"-Frizzlepuss. Jumpathon 5! play now!
The scratch song! Congratulations scratch! 2 million projects!

Offline

 

#5 2011-06-21 19:06:41

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: i need a script for a program i'm making

I'm not really sure what you mean by that... if you want it to be in a specific area, I suppose you could have some variables set for a position, and check to see if the sprite is within a certain distance of that point before you're allowed to set it down.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#6 2011-06-22 08:21:20

PlutoIsHades
Scratcher
Registered: 2010-10-18
Posts: 1000+

Re: i need a script for a program i'm making

Try this:
       When sprite clicked
       Repeat until <mouse down?>:
         Go to mouse pointer
         Wait 0.1 secs
        If <mouse down?>
         Stamp

Not sure if this will work, but you can try.


Minecraft, Redwall, and Cyberchase fan, and PROUD.

Offline

 

Board footer