Discuss Scratch

deck26
Scratcher
1000+ posts

How do I make a sprite appear at a random position at the top border?

So the bit of script you have is not connected to a header block so can be run manually but doesn't run with the project.

You don't have 90 costumes so costume# can never be 90!
GoodChristianName
Scratcher
14 posts

How do I make a sprite appear at a random position at the top border?

deck26 wrote:

So the bit of script you have is not connected to a header block so can be run manually but doesn't run with the project.

You don't have 90 costumes so costume# can never be 90!

I think I understand that, so a header block are blocks like this:

when green flag clicked
when [ v] key pressed
GoodChristianName
Scratcher
14 posts

How do I make a sprite appear at a random position at the top border?

GoodChristianName wrote:

deck26 wrote:

So the bit of script you have is not connected to a header block so can be run manually but doesn't run with the project.

You don't have 90 costumes so costume# can never be 90!

I think I understand that, so a header block are blocks like this:

when green flag clicked
when [ v] key pressed


Nope, put a when flag is clicked block on top of that script and it stilll doesn't work.

Last edited by GoodChristianName (Oct. 27, 2017 16:42:22)

Uniquename1
Scratcher
100+ posts

How do I make a sprite appear at a random position at the top border?

The way you're using
(costume #)

is checking for the costume # of the target sprite 909.

What you want to know is if

([ costume #] of [poopoloobalab v]) = 2

Which would mean you are punching.

Also pay attention to the difference between costume# and costume name. The name is any name you give it (could be a number) but the number is which one is it from the list 1st, 2nd, 3rd etc. Also don't name things similar names like 909 and 099.

With just a flag it only checks once when green flag clicked. It needs a flag and forever or you can put it in with the other forever right above it.

Like here: https://scratch.mit.edu/projects/182653363/

Last edited by Uniquename1 (Oct. 27, 2017 16:47:30)

GoodChristianName
Scratcher
14 posts

How do I make a sprite appear at a random position at the top border?

Uniquename1 wrote:

The way you're using
(costume #)

is checking for the costume # of the target sprite 909.

What you want to know is if

([ costume #] of [poopoloobalab v]) = 2

Which would mean you are punching.

Also pay attention to the difference between costume# and costume name. The name is any name you give it (could be a number) but the number is which one is it from the list 1st, 2nd, 3rd etc. Also don't name things similar names like 909 and 099.

With just a flag it only checks once when green flag clicked. It needs a flag and forever or you can put it in with the other forever right above it.

Like here: https://scratch.mit.edu/projects/182653363/
OH!! Thanks so much! I've learned alot from this project so far, wow.

I assure you, I do understand, but I can't really put it into words.
GoodChristianName
Scratcher
14 posts

How do I make a sprite appear at a random position at the top border?

GoodChristianName wrote:

Uniquename1 wrote:

The way you're using
(costume #)

is checking for the costume # of the target sprite 909.

What you want to know is if

([ costume #] of [poopoloobalab v]) = 2

Which would mean you are punching.

Also pay attention to the difference between costume# and costume name. The name is any name you give it (could be a number) but the number is which one is it from the list 1st, 2nd, 3rd etc. Also don't name things similar names like 909 and 099.

With just a flag it only checks once when green flag clicked. It needs a flag and forever or you can put it in with the other forever right above it.

Like here: https://scratch.mit.edu/projects/182653363/
OH!! Thanks so much! I've learned alot from this project so far, wow.

I assure you, I do understand, but I can't really put it into words.
Hey guys! Thank you so so so so so so so so so so much for the help through this project.
I really and truly appreciate it. I know I've said it so many times, but I really am.
I put everyone on this threads name in the credits, and you can check the game out on my profile.
-Warning, it is pretty bad, but it's the best I can do at this point.
PeachRing44
Scratcher
1 post

How do I make a sprite appear at a random position at the top border?

How do I spawn objects (thirty small objects) in random areas?
mlcreater
Scratcher
1000+ posts

How do I make a sprite appear at a random position at the top border?

PeachRing44 wrote:

How do I spawn objects (thirty small objects) in random areas?
Don't necropost - read the dates.
meneerple
Scratcher
1 post

How do I make a sprite appear at a random position at the top border?

thanks for helping
i will make a random position for y only
codeman1044
Scratcher
1000+ posts

How do I make a sprite appear at a random position at the top border?

meneerple wrote:

thanks for helping
i will make a random position for y only
No need to thank a topic that was created in 2015 though. Please avoid necroposting.
ResExsention
New Scratcher
1000+ posts

How do I make a sprite appear at a random position at the top border?

codeman1044 wrote:

meneerple wrote:

thanks for helping
i will make a random position for y only
No need to thank a topic that was created in 2015 though. Please avoid necroposting.

No need to thank a topic that was created in 2015 2017 though. Please avoid necroposting.

Feel free to create your own topic if you have any questions, though!
codeman1044
Scratcher
1000+ posts

How do I make a sprite appear at a random position at the top border?

ResExsention wrote:

No need to thank a topic that was created in 2015 2017 though.
The topic was created in 2015, and was carried to 2017. I put 2015 because I said created.

codeman1044 wrote:

No need to thank a topic that was created in 2015 though.
I think you might have missed something Res.
GamedesignerAO
New Scratcher
1 post

How do I make a sprite appear at a random position at the top border?

To make a sprite spawn form wherever at the top of the screen and go to the bottom use this code

when green flag clicked
go to x: (pick random (-205) to (205)) y: (147)
forever
change y by (-4.2)
if <touching [ edge] ?> then
go to x: (pick random (-205) to (205)) y: (147)
change y by (-4.2)

end
end
ThatOneWeirdDude
Scratcher
1000+ posts

How do I make a sprite appear at a random position at the top border?

Necropostbegone!

If you have a question please make a new topic

Powered by DjangoBB