This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-08-31 16:31:22

Kurtis999Bevan
Scratcher
Registered: 2011-01-13
Posts: 8

Bouncing

Hi everyone could anyone help me with something
i have made a basketball game and i want the ball to bounce off other sprites can anyone give me a script please
Thanks (i will credit you in the game)

Offline

 

#2 2011-08-31 19:01:09

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Bouncing

Uh maybe this project could help you? It has a ball in it that bounces with perfect angles  tongue  (If you do use the code in that project, don't give credit to me as I didn't make it)


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#3 2011-09-01 06:27:37

Kurtis999Bevan
Scratcher
Registered: 2011-01-13
Posts: 8

Re: Bouncing

Jonathanpb wrote:

Uh maybe this project could help you? It has a ball in it that bounces with perfect angles  tongue  (If you do use the code in that project, don't give credit to me as I didn't make it)

Thanks for the link unfortunately it didn't work

Offline

 

#4 2011-09-03 13:54:15

Kurtis999Bevan
Scratcher
Registered: 2011-01-13
Posts: 8

Re: Bouncing

By the way it is click and drag ball if it helps

Offline

 

#5 2011-09-03 14:45:37

fortmcas
Scratcher
Registered: 2009-07-26
Posts: 48

Re: Bouncing

If touching sprite _____, than if on edge bounce, or could be replaced with: turn ___ degrees, and move ___ steps

Hope this helps  smile

Offline

 

#6 2011-09-03 14:47:28

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Bouncing

Do you mean you drag the ball with your mouse and when you let go the ball continues moving?


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#7 2011-10-02 15:13:43

Kurtis999Bevan
Scratcher
Registered: 2011-01-13
Posts: 8

Re: Bouncing

MoreGamesNow wrote:

Do you mean you drag the ball with your mouse and when you let go the ball continues moving?

Yes it is like that

Offline

 

#8 2011-10-02 20:24:25

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Bouncing

I've never done it, but I'd start by recording mouse x and y positions from when the ball is clicked to until it is released.  Then find the speed and direction based on those coordinates.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#9 2011-10-03 07:12:58

legoguy23
Scratcher
Registered: 2011-09-20
Posts: 15

Re: Bouncing

try this you may not find some of the blocks but it should work[blocks]<when green flag clicked><forever><if><touching[sprites <point in direction( <<  <not>  >>sprite touched <move(20 )steps><end>[/blocks]
____________________________________________________________________________________
play my games using this link http://scratch.mit.edu/users/legoguy23

Offline

 

#10 2011-10-03 07:16:16

legoguy23
Scratcher
Registered: 2011-09-20
Posts: 15

Re: Bouncing

its confusing now it shows photos ???          ?
                                                         roll

Last edited by legoguy23 (2011-11-07 14:59:38)

Offline

 

#11 2011-10-03 07:30:58

Daroach1
Scratcher
Registered: 2011-09-11
Posts: 1000+

Re: Bouncing

use basic colors and put color sensors in with if touching color _ is the easiest way! or do second hand sprite sensors its pretty easy once you try it!  big_smile


http://i47.tinypic.com/v83mhl.png

Offline

 

#12 2011-10-29 07:11:10

Kurtis999Bevan
Scratcher
Registered: 2011-01-13
Posts: 8

Re: Bouncing

fortmcas wrote:

If touching sprite _____, than if on edge bounce, or could be replaced with: turn ___ degrees, and move ___ steps

Hope this helps  smile

I know this wouldn't work because when it says if on edge bounce it means on the edge of the screen

Offline

 

#13 2011-11-12 02:21:25

legoguy23
Scratcher
Registered: 2011-09-20
Posts: 15

Re: Bouncing

this link will work
http://scratch.mit.edu/projects/Lucario621/121475
big_smile

Offline

 

#14 2012-08-25 19:47:28

nrgjay101
Scratcher
Registered: 2012-06-30
Posts: 5

Re: Bouncing

i'm making a proect and i don't know how to make the ball bounce off the paddle

Offline

 

#15 2012-08-25 20:28:57

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Bouncing

nrgjay101 wrote:

i'm making a proect and i don't know how to make the ball bounce off the paddle

Post a new thread if you have a question.  It helps keep the forums more organized  smile

Edit: this thread/post might help you

Last edited by MoreGamesNow (2012-08-25 20:29:45)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer