Discuss Scratch

deck26
Scratcher
1000+ posts

drag and drop

The mouse must be down when the sprite has just been clicked so you just need to check for touching the gingerbreadman.

Is your project online or offline because it would be much easier to help if you were sharing an online project?
samaneh_62
New Scratcher
39 posts

drag and drop

Hi.With your guidance s I did it it works properly and I'm so happy now I'm working on other projects.
It's offline.If you want to see it I can share.
samaneh_62
New Scratcher
39 posts

drag and drop

I have 3 question more if it possible please,
1-My sprites have high quality but when I import them to scratch,their quality decreases intensively.why?
2-How could we make a game with many rounds like Gingerbread man game,so that when player click “try again” button,next round loads with random questions?
3-How could we build a swf file from our scratch project?

deck26
Scratcher
1000+ posts

drag and drop

The quality of your sprite costumes may depend on the size - if they're too big they need to be compressed to the size Scratch can cope with.

A game with many rounds is easy enough. There will be variables etc that need to be reset (eg all the buttons put back in starting positions, count set back to 0). I'd suggest a loop that handles a single round. There will be variables like a score which don't get reset. The ‘random a to b’ block can be used to randomise the questions but you may wish to avoid the same number coming up twice.

http://wiki.scratch.mit.edu/wiki/Porting_Scratch_Projects may answer your third question.
bjskistad
Scratcher
1000+ posts

drag and drop

samaneh_62 wrote:

I wrote this:
when this sprite clicked
if <<touching [ v] ?> and <<mouse down?> >> then

change [ v] by (-1)
end

it seems that it works.is it true?
That works too.
deck26
Scratcher
1000+ posts

drag and drop

bjskistad wrote:

samaneh_62 wrote:

I wrote this:
when this sprite clicked
if <<touching [ v] ?> and <<mouse down?> >> then

change [ v] by (-1)
end

it seems that it works.is it true?
That works too.
I didn't say it wouldn't work, just that the check for mouse down is likely to be pointless as if the sprite is clicked the mouse will almost certainly still be down by the time that block is interpreted. In any case it is redundant since what you care about is the sprite being clicked.

Last edited by deck26 (Dec. 8, 2015 15:10:14)

bjskistad
Scratcher
1000+ posts

drag and drop

deck26 wrote:

bjskistad wrote:

samaneh_62 wrote:

I wrote this:
when this sprite clicked
if <<touching [ v] ?> and <<mouse down?> >> then

change [ v] by (-1)
end

it seems that it works.is it true?
That works too.
I didn't say it wouldn't work, just that the check for mouse down is likely to be pointless as if the sprite is clicked the mouse will almost certainly still be down by the time that block is interpreted. In any case it is redundant since what you care about is the sprite being clicked.
You're right, it would be pointless, the only reason you would use that script is if you used a forever block.
samaneh_62
New Scratcher
39 posts

drag and drop

deck26 wrote:

The quality of your sprite costumes may depend on the size - if they're too big they need to be compressed to the size Scratch can cope with.

A game with many rounds is easy enough. There will be variables etc that need to be reset (eg all the buttons put back in starting positions, count set back to 0). I'd suggest a loop that handles a single round. There will be variables like a score which don't get reset. The ‘random a to b’ block can be used to randomise the questions but you may wish to avoid the same number coming up twice.

http://wiki.scratch.mit.edu/wiki/Porting_Scratch_Projects may answer your third question.

Thank you.it was so useful
samaneh_62
New Scratcher
39 posts

drag and drop

Hi guys
I want to say below code in scratch.how could I write that?
if sprite1.show then
counter +=1
and don't want to use broadcast.
Tanks
deck26
Scratcher
1000+ posts

drag and drop

samaneh_62 wrote:

Hi guys
I want to say below code in scratch.how could I write that?
if sprite1.show then
counter +=1
and don't want to use broadcast.
Tanks
Do you mean you want the counter to increment by 1 if sprite1 is showing? There is no built-in method to tell if a sprite is showing so use a variable and set it to 1 whenever you tell the sprite to show and to 0 whenever you tell it to hide.

Powered by DjangoBB