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

#1 2010-02-17 19:07:01

indy1998
Scratcher
Registered: 2010-02-17
Posts: 14

Help

Things wont bounce of walls even if I put on edge bounce in.


Indy1998

Offline

 

#2 2010-02-17 19:34:43

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Help

Are the walls the edges of a sprite, or the stage?  The "if on edge bounce" block only bounces for the edges of the screen.

If you want to bounce off an object, you need "if touching (object) turn 90 degrees" (that is the simplest way, but there are more advanced ways that work much better than that, but it might take a while to write one down in an understandable way)

Last edited by Kileymeister (2010-02-17 20:13:52)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#3 2010-02-17 19:56:19

Toonboy
Scratcher
Registered: 2010-02-15
Posts: 30

Re: Help

Kiley is right.  smile

In other words......

1.Use the steps block instead of the change x/change y blocks.

2.Say something like:


<when green flag clicked>
<forever>
<if>
<touching color[ ?
<turn cw( 165 )degrees>
<move( ? )steps>
<end>
<end>

Replace any ? in the example with a custom modification.

If that doesn't make sense, please tell me.  smile


http://i44.tinypic.com/2rztovn.jpg

Offline

 

#4 2010-02-18 17:08:14

indy1998
Scratcher
Registered: 2010-02-17
Posts: 14

Re: Help

the exact proble is:the game is pong when the ball touches the screens edges it gets stuck


Indy1998

Offline

 

#5 2010-02-19 00:47:20

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

Re: Help

I think I see your problem - is the ball moving to the edge of the screen, without anything to stop it?

Here's a simple script that has the sprite move until it hits the edge, then point in the opposite direction and continue. You can try adapting the script to your liking. Here's the script:

http://img237.imageshack.us/img237/8868/49asimplebouncingscript.png
Any questions?

Last edited by Jonathanpb (2010-02-19 00:49:30)


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

Offline

 

Board footer