Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Please Help- Dragging
- 3puppydog15
- Scratcher
9 posts
Please Help- Dragging
I'm trying to make a project where you can drag objects onto another sprite. I can't figure out how to do it. PLEASE HELP!
This project is called ‘Fun Town’
Also, I'm making a game, and I don't know how to make the sprite glide downwards as it's jumping. PLEASE HELP ME!!!!
This project is called ‘Fun Town’
Also, I'm making a game, and I don't know how to make the sprite glide downwards as it's jumping. PLEASE HELP ME!!!!
- Zambonifofex
- Scratcher
100+ posts
Please Help- Dragging
I don't understand your first question.
but for your second the answer is really simple:
but for your second the answer is really simple:
when I receive [jump v]
set [delta speed v] to [50]
when green flag clicked
forever
if <touching [ground v]?> then
set [delta speed v] to [0]
else
change [delta speed v] by (-1)
end
change y by (delta speed)
end
Last edited by Zambonifofex (Jan. 3, 2014 21:06:36)
You've just lost The Game
Click here to check out an awesome game, Patapony
- GlennWright
- Scratcher
100+ posts
Please Help- Dragging
Sorry I included the script for mouse-dragging, not dragging into other objects!
Last edited by GlennWright (Jan. 3, 2014 17:47:23)
Happy Testing!
- 3puppydog15
- Scratcher
9 posts
Please Help- Dragging
Zambonifofex,
I meant as in, like when you doing a dress up game, you can drag the clothes on the person. I can't figure out how to do that.
I meant as in, like when you doing a dress up game, you can drag the clothes on the person. I can't figure out how to do that.
- drmcw
- Scratcher
1000+ posts
Please Help- Dragging
Zambonifofex,
I meant as in, like when you doing a dress up game, you can drag the clothes on the person. I can't figure out how to do that.
when this sprite clicked
repeat until <not <mouse down?>>
go to [mouse-pointer v]
end
- Zambonifofex
- Scratcher
100+ posts
Please Help- Dragging
Why to use blocks to make that?Zambonifofex,
I meant as in, like when you doing a dress up game, you can drag the clothes on the person. I can't figure out how to do that.when this sprite clicked
repeat until <not <mouse down?>>
go to [mouse-pointer v]
end
Just click the “i” on the top left cornor of the sprite, and mark the option “can drag in player”
You've just lost The Game
Click here to check out an awesome game, Patapony
- drmcw
- Scratcher
1000+ posts
Please Help- Dragging
Why to use blocks to make that?Zambonifofex,
I meant as in, like when you doing a dress up game, you can drag the clothes on the person. I can't figure out how to do that.when this sprite clicked
repeat until <not <mouse down?>>
go to [mouse-pointer v]
end
Just click the “i” on the top left cornor of the sprite, and mark the option “can drag in player”
The “allow drag in player” imho was a big mistake for the ST to add and can crash the player and works differently for editor and player. Scripting it is good practise and more flexible.
- Zambonifofex
- Scratcher
100+ posts
Please Help- Dragging
it never crashed to me. And also, what's the differece? i haven't spoted any…Why to use blocks to make that?Zambonifofex,
I meant as in, like when you doing a dress up game, you can drag the clothes on the person. I can't figure out how to do that.when this sprite clicked
repeat until <not <mouse down?>>
go to [mouse-pointer v]
end
Just click the “i” on the top left cornor of the sprite, and mark the option “can drag in player”
The “allow drag in player” imho was a big mistake for the ST to add and can crash the player and works differently for editor and player. Scripting it is good practise and more flexible.
You've just lost The Game
Click here to check out an awesome game, Patapony
- Zambonifofex
- Scratcher
100+ posts
Please Help- Dragging
this for the difference. As for crashing it then there're discussions in bugs and glitches but basically to crash the player you need to be dragging a clone and have it deleted while you are dragging it.They are just some bugs, they will probably be fixed soon (or not) =P See
You've just lost The Game
Click here to check out an awesome game, Patapony
- drmcw
- Scratcher
1000+ posts
Please Help- Dragging
Well I'd say not. Just one of those seemed like a good idea at the time but wasn't fully thought through things.this for the difference. As for crashing it then there're discussions in bugs and glitches but basically to crash the player you need to be dragging a clone and have it deleted while you are dragging it.They are just some bugs, they will probably be fixed soon (or not) =P See
- 1234abcdcba4321
- Scratcher
1000+ posts
Please Help- Dragging
More complicated script, but smoother:
when this sprite clicked
set [X v] to ((x position) - (mouse x))
set [Y v] to ((y position) - (mouse y))
repeat until <not <mouse down?>>
go to x: ((X) + (mouse x)) y: ((Y) + (mouse y))
end
Last edited by 1234abcdcba4321 (Jan. 3, 2014 20:35:43)
I'd highly appreciate it if you were to follow me. Don't forget to go to my profile.
All of my programming suggestions <— You should really get the suggestions move back to the suggestions forum!
Five hundred posts! I never expected to get up there… In only 2-3 months.
Does anyone know what a signature is? I mean, I've already seen 6-7 people get confused.
- clickforgames
- Scratcher
45 posts
Please Help- Dragging
Also, I'm making a game, and I don't know how to make the sprite glide downwards as it's jumping. PLEASE HELP ME!!!!
I recommend searching for a base and importing it into your project.
Last edited by clickforgames (Jan. 3, 2014 21:04:11)
- Discussion Forums
- » Help with Scripts
- » Please Help- Dragging