Discuss Scratch

SuperKing7
Scratcher
9 posts

bouncing ball

Dear scratchers,

I am making a game and I am struggling in a sprites scripts.
So I have ball, I want the ball to go to the left starting on a speed of -10 slowing down by 0.05. While it is going left I also want the ball to be bouncing and when the ball hits the ground I want it to bounce back up 9/10 of where it started and on the second bounce bounce up to 9/10 of how high the first bounce went up to and on with the third fourth forever. The ball will bounce at least 2 times and at most 5 times.
If you know a script or scripts that can do that please reply and paste the script/scripts on your reply.

Thank you
asivi
Scratcher
1000+ posts

bouncing ball

What must happen when the ball reaches the left edge?
SuperKing7
Scratcher
9 posts

bouncing ball

asivi wrote:

What must happen when the ball reaches the left edge?

It disappears when it reach left edge
asivi
Scratcher
1000+ posts

bouncing ball

Hi, https://scratch.mit.edu/projects/114077053/ could be you are searching for.
SuperKing7
Scratcher
9 posts

bouncing ball

asivi wrote:

Hi, https://scratch.mit.edu/projects/114077053/ could be you are searching for.
Thank you for helping, I really like it but I want it to be smooth. Thank you for trying to help.
SuperKing7
Scratcher
9 posts

bouncing ball

SuperKing7 wrote:

asivi wrote:

Hi, https://scratch.mit.edu/projects/114077053/ could be you are searching for.
Thank you
SuperKing7
Scratcher
9 posts

bouncing ball

thanks!!!
asivi
Scratcher
1000+ posts

bouncing ball

SuperKing7 wrote:

asivi wrote:

Hi, https://scratch.mit.edu/projects/114077053/ could be you are searching for.
Thank you for helping, I really like it but I want it to be smooth. Thank you for trying to help.
Can you define smooth, at what terms?
SuperKing7
Scratcher
9 posts

bouncing ball

asivi wrote:

SuperKing7 wrote:

asivi wrote:

Hi, https://scratch.mit.edu/projects/114077053/ could be you are searching for.
Thank you for helping, I really like it but I want it to be smooth. Thank you for trying to help.
Can you define smooth, at what terms?

Your ball is very fast when going up, I want it to glide up, and it has the same speed when going down, I want the ball to start going down slow but then get faster.
Thank you!!!


yclee0206
Scratcher
100+ posts

bouncing ball

Is this what you are looking for?

whenclickedgotox:230y:-33setmaxheightto100setspeedto10pointindirection-90showbroadcaststartwhenIreceivestartforevermovespeed/10stepsiftouchingedge?thenhidestopallchangespeedby-0.05whenIreceivestartforeverrepeatuntiltouchingground?changeybymaxheight*-0.1setmaxheighttomaxheight*0.9repeatuntilyposition>maxheight+-133changeybymaxheight*0.1

Last edited by yclee0206 (June 17, 2016 10:40:48)

yclee0206
Scratcher
100+ posts

bouncing ball

Using the above script, the ball will go up more smoothly, but the speed while moving up and down still wouldn't change.

Last edited by yclee0206 (June 17, 2016 10:43:50)

yclee0206
Scratcher
100+ posts

bouncing ball

This might solve the problem

whenclickedgotox:230y:-33setmaxheightto100setspeedto10pointindirection-90showbroadcaststartwhenIreceivestartforevermovespeed/10stepsiftouchingedge?thenhidestopallchangespeedby-0.05whenIreceivestartforeverrepeatuntiltouchingground?changeybymaxheight*-0.1/yposition-133setmaxheighttomaxheight*0.9repeatuntilyposition>maxheight+-133changeybymaxheight*0.1/33-yposition


Last edited by yclee0206 (June 17, 2016 10:49:31)

yclee0206
Scratcher
100+ posts

bouncing ball

Is it part of your ‘really complex project’?
asivi
Scratcher
1000+ posts

bouncing ball

The problem is the x speed, there is not time to do a really smooth movement for bouncing.
Soplar y sorber no puede ser.
yclee0206
Scratcher
100+ posts

bouncing ball

This project made by griffpatchtutor might help you. https://scratch.mit.edu/projects/67727504/

Last edited by yclee0206 (June 17, 2016 11:20:27)

Powered by DjangoBB