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

#1 2011-03-14 03:48:22

misse
New Scratcher
Registered: 2011-02-09
Posts: 14

I could need some help, again..

Hey, i have this level were there is a lot of planets. All the planets have a script. I want the player to drag around with the planets, but they are locked in the position i gave them. How gan i make them go unlocked so the player can drag around with them, but still go to the position i gave them in the beginning?

Offline

 

#2 2011-03-14 21:45:54

kingofdallamas
Scratcher
Registered: 2010-03-07
Posts: 500+

Re: I could need some help, again..

Use these scripts:
(1:MANDATORY)When green flag clicked,
                       Go to x:_ y:_
The x-coordinate and y-coordinate are the place where the sprite will first start at, and then continue the script with this:
[continued]…

(2) http://i34.tinypic.com/20j1us4.jpg

or you can use this...

(3) when green flag clicked
-forever if touching mouse-pointer and mouse down?
--set mousepastx to mouse x
--set mousepasty to mouse y
--repeat until not mouse down?
---change x by mousex - mousepastx
---change y by mousey -mousepasty
---set mousepastx to mouse x
---set mousepasty to mouse y


There you go! And, you know you don't have to use the last two scripts (2) and (3) to make the sprite draggable. There is a little lock icon near the top of the program with the sprite. Click the lock, and this allows the sprite to be dragged on presentation mode and online.  smile


http://i853.photobucket.com/albums/ab99/Gilgamesh1192/Ninja%20Saga/ElementalJutsus2.gifhttp://i27.photobucket.com/albums/c192/BoomKaTish/GIF/thgfhgfhfhgf.gif
ハロー友だち!

Offline

 

#3 2011-03-15 01:36:45

Chatter
Scratcher
Registered: 2009-11-29
Posts: 500+

Re: I could need some help, again..

If you see the textbox where you can change the sprite name, then there's a lock. Click that lock. It makes it so that the sprite is draggable  smile


http://img19.imageshack.us/img19/2339/mcdonaldsjoke.gifAll your problems are like batter when you add a little Chatter, because when you have Chat, you're safe from bats.  big_smile
"And so?" - The little people in my brain|Status: Snow in April?

Offline

 

#4 2011-03-15 07:09:20

Enzo1997
Scratcher
Registered: 2008-06-14
Posts: 500+

Re: I could need some help, again..

kingofdallamas wrote:

Use these scripts:
(1:MANDATORY)When green flag clicked,
                       Go to x:_ y:_
The x-coordinate and y-coordinate are the place where the sprite will first start at, and then continue the script with this:
[continued]…

(2) http://i34.tinypic.com/20j1us4.jpg

or you can use this...

(3) when green flag clicked
-forever if touching mouse-pointer and mouse down?
--set mousepastx to mouse x
--set mousepasty to mouse y
--repeat until not mouse down?
---change x by mousex - mousepastx
---change y by mousey -mousepasty
---set mousepastx to mouse x
---set mousepasty to mouse y


There you go! And, you know you don't have to use the last two scripts (2) and (3) to make the sprite draggable. There is a little lock icon near the top of the program with the sprite. Click the lock, and this allows the sprite to be dragged on presentation mode and online.  smile

Llama you are making things too complex.

When Green Flag Clicked
Forever If Touching Mouse Pointer and Mouse Down
Go to mouse pointer


Your music tastes are bad, therefore your argument is irrelevant.

Offline

 

#5 2011-03-15 16:07:45

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: I could need some help, again..

Enzo1997 wrote:

kingofdallamas wrote:

Use these scripts:
(1:MANDATORY)When green flag clicked,
                       Go to x:_ y:_
The x-coordinate and y-coordinate are the place where the sprite will first start at, and then continue the script with this:
[continued]…

(2) http://i34.tinypic.com/20j1us4.jpg

or you can use this...

(3) when green flag clicked
-forever if touching mouse-pointer and mouse down?
--set mousepastx to mouse x
--set mousepasty to mouse y
--repeat until not mouse down?
---change x by mousex - mousepastx
---change y by mousey -mousepasty
---set mousepastx to mouse x
---set mousepasty to mouse y


There you go! And, you know you don't have to use the last two scripts (2) and (3) to make the sprite draggable. There is a little lock icon near the top of the program with the sprite. Click the lock, and this allows the sprite to be dragged on presentation mode and online.  smile

Llama you are making things too complex.

When Green Flag Clicked
Forever If Touching Mouse Pointer and Mouse Down
Go to mouse pointer

Not a very reliable method, it makes the sprite jump to center of your mouse pointer and if you drag it too fast the sprite stops moving with the mouse.

misse, either use llama's method if the sprites need to stay in their proper layer position, or do what Chatter said.  Chatter's method is really the easiest.

Last edited by Kileymeister (2011-03-15 16:08:04)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#6 2011-03-15 19:41:36

Chatter
Scratcher
Registered: 2009-11-29
Posts: 500+

Re: I could need some help, again..

Kileymeister wrote:

Chatter's method is really the easiest.

big_smile  I'm smart!


http://img19.imageshack.us/img19/2339/mcdonaldsjoke.gifAll your problems are like batter when you add a little Chatter, because when you have Chat, you're safe from bats.  big_smile
"And so?" - The little people in my brain|Status: Snow in April?

Offline

 

#7 2011-03-16 18:38:39

kingofdallamas
Scratcher
Registered: 2010-03-07
Posts: 500+

Re: I could need some help, again..

kingofdallamas wrote:

There is a little lock icon near the top of the program with the sprite. Click the lock, and this allows the sprite to be dragged on presentation mode and online.  smile

I also wrote that too. The lock method for number three choice.


http://i853.photobucket.com/albums/ab99/Gilgamesh1192/Ninja%20Saga/ElementalJutsus2.gifhttp://i27.photobucket.com/albums/c192/BoomKaTish/GIF/thgfhgfhfhgf.gif
ハロー友だち!

Offline

 

#8 2011-03-16 18:40:02

kingofdallamas
Scratcher
Registered: 2010-03-07
Posts: 500+

Re: I could need some help, again..

Chatter wrote:

Kileymeister wrote:

Chatter's method is really the easiest.

big_smile  I'm smart!

Resourceful, you mean.  smile  I also mentioned the lock method too, but nobody seemed to notice that part.  hmm


http://i853.photobucket.com/albums/ab99/Gilgamesh1192/Ninja%20Saga/ElementalJutsus2.gifhttp://i27.photobucket.com/albums/c192/BoomKaTish/GIF/thgfhgfhfhgf.gif
ハロー友だち!

Offline

 

#9 2011-03-17 07:50:31

misse
New Scratcher
Registered: 2011-02-09
Posts: 14

Re: I could need some help, again..

Hey guys, help again? if i want a script to move left and right when left arrow and right arrow key are pressed, how do i do that? I have tried by my self, but that did not work at all  smile

Offline

 

#10 2011-03-17 11:56:32

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: I could need some help, again..

Try this

<when green flag clicked>
<forever>
<if> <key[ right arrow key ]pressed?>
<point in direction( 90
<move( 10 )steps>
<if> <key[ left arrow ]pressed?>
<point in direction(-90
<move( 10 )steps>
<end>

Last edited by muppetds (2011-03-17 11:58:08)


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#11 2011-03-17 13:48:33

misse
New Scratcher
Registered: 2011-02-09
Posts: 14

Re: I could need some help, again..

Year that would work for the right arrow-key, but lot for the left. My sprite cant turn 180 degrees, that would look wired in the game because it is a cyclist.

Offline

 

#12 2011-03-17 14:05:43

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: I could need some help, again..

misse wrote:

Year that would work for the right arrow-key, but lot for the left. My sprite cant turn 180 degrees, that would look wired in the game because it is a cyclist.

Up by the sprite name, there are a set of small buttons (some with arrows on them) that control how the costume turns as the sprite turns.  If you don't want the costume to turn at all, you can set it to "don't rotate".  If you want the costume to flip left and right but nothing else, you can do that too, by setting it to "only face left-right".  So that might help you with your problem with the cyclist.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#13 2011-03-17 14:47:06

Chatter
Scratcher
Registered: 2009-11-29
Posts: 500+

Re: I could need some help, again..

kingofdallamas wrote:

Chatter wrote:

Kileymeister wrote:

Chatter's method is really the easiest.

big_smile  I'm smart!

Resourceful, you mean.  smile  I also mentioned the lock method too, but nobody seemed to notice that part.  hmm

Oh oops lol ^^"


http://img19.imageshack.us/img19/2339/mcdonaldsjoke.gifAll your problems are like batter when you add a little Chatter, because when you have Chat, you're safe from bats.  big_smile
"And so?" - The little people in my brain|Status: Snow in April?

Offline

 

#14 2011-03-17 15:29:00

misse
New Scratcher
Registered: 2011-02-09
Posts: 14

Re: I could need some help, again..

Thanks that worked, what if i want to make combinations? like i have a sprite and every time this sprite tutch sprite2, i want them to make the pot to boil. J have tried some different ways, but it wont work optimal. I want the player to drag the to sprites to the pot, and the make the pot boil and the sprites will go back on their original place?

Offline

 

#15 2011-03-17 15:31:46

Chatter
Scratcher
Registered: 2009-11-29
Posts: 500+

Re: I could need some help, again..

misse wrote:

Thanks that worked, what if i want to make combinations? like i have a sprite and every time this sprite tutch sprite2, i want them to make the pot to boil. J have tried some different ways, but it wont work optimal. I want the player to drag the to sprites to the pot, and the make the pot boil and the sprites will go back on their original place?

<when green flag clicked>
<forever>
<if><touching[ pot
<hide>
<broadcast[ potboil
<end>
<end>


<when I receive[ potboil
<switch to costume[ potboil

smile

Last edited by Chatter (2011-03-17 15:32:14)


http://img19.imageshack.us/img19/2339/mcdonaldsjoke.gifAll your problems are like batter when you add a little Chatter, because when you have Chat, you're safe from bats.  big_smile
"And so?" - The little people in my brain|Status: Snow in April?

Offline

 

#16 2011-03-18 04:10:25

misse
New Scratcher
Registered: 2011-02-09
Posts: 14

Re: I could need some help, again..

What if the pot shall boil when sprite1 and sprite 2 both touch the pot at the same time, not just one of them?

Offline

 

#17 2011-03-18 18:49:42

kingofdallamas
Scratcher
Registered: 2010-03-07
Posts: 500+

Re: I could need some help, again..

misse wrote:

What if the pot shall boil when sprite1 and sprite 2 both touch the pot at the same time, not just one of them?

Then, do these scripts for the pot...
<when green flag clicked>
<forever>
<if> <<touching[sprite1]>and<touching[sprite 2]>
<do the action you want it to do>
<end>

Yeah, that's pretty much it!  smile


http://i853.photobucket.com/albums/ab99/Gilgamesh1192/Ninja%20Saga/ElementalJutsus2.gifhttp://i27.photobucket.com/albums/c192/BoomKaTish/GIF/thgfhgfhfhgf.gif
ハロー友だち!

Offline

 

Board footer