Discuss Scratch

canarycat2000
Scratcher
500+ posts

A drag and drop game where you feed characters

Suppose you're making a game where you drag different foods to different characters.

I want it to be drag and drop, where the character only eats the food when you're giving to them, and you release the mouse.

Is there a way to do this?
canarycat2000
Scratcher
500+ posts

A drag and drop game where you feed characters

Also, I would like the characters to react when you're hovering food over them(before you give it to them)

How do I program that as well?
Scratchtheguy1
Scratcher
100+ posts

A drag and drop game where you feed characters

if <mouse down?> then
...
end



if <touching [ ???] ?> then
broadcast [ eat]
end
will it work?

Last edited by Scratchtheguy1 (Feb. 20, 2025 19:50:04)

HighlaneGamingStudio
Scratcher
100+ posts

A drag and drop game where you feed characters

Food sprite:
when green flag clicked
set drag mode to [draggable v]::sensing
forever
if <<not <mouse down?>> and <touching [character v] ?>> then
broadcast [eat v]
hide//Change to delete this clone if you're using clones, or go to (0) (0) if you want it to reset to its original position.
end
end

Powered by DjangoBB