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
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)
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.
Offline
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
Offline
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.
Llama you are making things too complex.
When Green Flag Clicked
Forever If Touching Mouse Pointer and Mouse Down
Go to mouse pointer
Offline
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.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)
Offline
Kileymeister wrote:
Chatter's method is really the easiest.
I'm smart!
Offline
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.
I also wrote that too. The lock method for number three choice.
Offline
Chatter wrote:
Kileymeister wrote:
Chatter's method is really the easiest.
I'm smart!
Resourceful, you mean. I also mentioned the lock method too, but nobody seemed to notice that part.
Offline
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)
Offline
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.
Offline
kingofdallamas wrote:
Chatter wrote:
Kileymeister wrote:
Chatter's method is really the easiest.
I'm smart!
Resourceful, you mean. I also mentioned the lock method too, but nobody seemed to notice that part.
Oh oops lol ^^"
Offline
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
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
Last edited by Chatter (2011-03-17 15:32:14)
Offline
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!
Offline