Discuss Scratch

Barm88
Scratcher
17 posts

Need help with cloning

Hey, I am making a game where you have to kick a ball up in the air with your foot, and I try to make it so that when you have 10 points a second ball comes in (with cloning) and at 20 and 30 and maybe even further. This is my project: http://scratch.mit.edu/projects/18258137/#editor please help Thanks
Barm88
Scratcher
17 posts

Need help with cloning

Sorry I didn't adress the problem: When it gets to 10 points it makes infinite amount of clones instead of just 1 ball, I know this is because i used ‘'Forever’' but without it it won't repeat at the second time… anyone know how to solve this? Help much appreciated!
ErnieParke
Scratcher
1000+ posts

Need help with cloning

You actually aren't making an infinite amount of balls. You included a [stop [this script v]] block, which stops the script from making anymore balls, which prevents the infinity ball problem. It causes a different problem, though. You want more balls with a score of 20, 30, and so on; but they won't appear because your script is stopped. So what you need is:

whenclickedwait0secswaituntilscore>9createcloneofmyselfwaituntilscore>19createcloneofmyselfwaituntilscore>29createcloneofmyself. . .And more.

By the way, even though you have your original problem is fixed, would you still like me to add in velocity?

Showing,

ErnieParke

Last edited by ErnieParke (Feb. 22, 2014 23:32:57)

Barm88
Scratcher
17 posts

Need help with cloning

@ErnieParke Thanks for the help, but i still couldn't get the cloning to work… And yes it would be great if you could do the velocity thing, and while you're at it can you also try to get the cloning to work? If you remix it I'll copy the scripts and bring them to my project (and give you credit). Thanks!
ErnieParke
Scratcher
1000+ posts

Need help with cloning

@Barm88:
Okay then. I'll get your project tidied up tomorrow and post it down below.

Happy,

ErnieParke
ErnieParke
Scratcher
1000+ posts

Need help with cloning

I've finished it! You can download it here.

One thing to note. There are two versions of the soccer ball in the project. The first one is basically what you asked for; it has velocity. The second soccer ball, though, I went further by cleaning up the code. I disabled some key scripts, though, so you'd have to reattach them to have the sprite run has normal.

Giving,

ErnieParke

Barm88
Scratcher
17 posts

Need help with cloning

@ErnieParke Hey, unfortunately I can't open it, windows says I need to specify what I want to open. Can you remix the problem and share it? That way i can just copy the scripts. And I assume you already remixed it right? So hopefully it won't be anymore work. Thanks.
KermitMC
Scratcher
100+ posts

Need help with cloning

ErnieParke wrote:

You actually aren't making an infinite amount of balls. You included a [stop [this script v]] block, which stops the script from making anymore balls, which prevents the infinity ball problem. It causes a different problem, though. You want more balls with a score of 20, 30, and so on; but they won't appear because your script is stopped. So what you need is:

whenclickedwait0secswaituntilscore>9createcloneofmyselfwaituntilscore>19createcloneofmyselfwaituntilscore>29createcloneofmyself. . .And more.

By the way, even though you have your original problem is fixed, would you still like me to add in velocity?

Showing,

ErnieParke
Or…
whenclickedsetamountto9foreverwaituntilscore>amountchangeamountby10createcloneofmyself
ErnieParke
Scratcher
1000+ posts

Need help with cloning

@KermitMC:
True, that would work, but then you also lose some flexibility in where the boundaries lie.

@Barm88:
I have the project shared! Here's the new link to it: SoccerKick Pro (Barm88)

Sharing,

ErnieParke
Mixlop
Scratcher
7 posts

Need help with cloning

Can I have help on my cloning based game please? http://scratch.mit.edu/projects/18536995/

Powered by DjangoBB