Discuss Scratch

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!!!!

Zambonifofex
Scratcher
100+ posts

Please Help- Dragging

I don't understand your first question.

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)

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!
RobbieH
Scratcher
38 posts

Please Help- Dragging

you need repeat -_change Y by_
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.

drmcw
Scratcher
1000+ posts

Please Help- Dragging

3puppydog15 wrote:

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

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
3puppydog15
Scratcher
9 posts

Please Help- Dragging

Thanks!

Zambonifofex
Scratcher
100+ posts

Please Help- Dragging

drmcw wrote:

3puppydog15 wrote:

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
Why to use blocks to make that?

Just click the “i” on the top left cornor of the sprite, and mark the option “can drag in player”
Sandkt25
Scratcher
14 posts
Sandkt25
Scratcher
14 posts

Please Help- Dragging

Here is an example I made for you
drmcw
Scratcher
1000+ posts

Please Help- Dragging

Zambonifofex wrote:

drmcw wrote:

3puppydog15 wrote:

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
Why to use blocks to make that?

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.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
Zambonifofex
Scratcher
100+ posts

Please Help- Dragging

drmcw wrote:

Zambonifofex wrote:

drmcw wrote:

3puppydog15 wrote:

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
Why to use blocks to make that?

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.
it never crashed to me. And also, what's the differece? i haven't spoted any…
drmcw
Scratcher
1000+ posts

Please Help- Dragging

See 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.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
Zambonifofex
Scratcher
100+ posts

Please Help- Dragging

drmcw wrote:

See 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
drmcw
Scratcher
1000+ posts

Please Help- Dragging

Zambonifofex wrote:

drmcw wrote:

See 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
Well I'd say not. Just one of those seemed like a good idea at the time but wasn't fully thought through things.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
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

3puppydog15 wrote:

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)

Powered by DjangoBB