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

#1 2012-07-07 20:09:57

pfred
New Scratcher
Registered: 2012-07-07
Posts: 2

Problem with: if on edge, bounce

I am re-creating a project from Scratch Programming for Teens (by Jerry Lee Ford) to introduce programming to young students in a summer camp.  The project is a simple fish tank with fish swimming back and forth.

This  project uses the following code on each fish sprite:


when gf clicked
 forever
    move [1] steps
    if on edge, bounce
  end forever 
The book CD has the sample project; the fish swim to the screen edge then turn and swim the opposite direction when they hit the edge.  My scripts are identical to his to animate the fish in the tank; however, when my fish **bounce**, the fish are reversed and upside down.

I only learned Scratch over the last few days, but I am not seeing why my fish are acting so goofy on the bounce.
Any help is greatly appreciated.  Thanks!

Offline

 

#2 2012-07-07 20:11:59

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: Problem with: if on edge, bounce

It's because it's set to rotate freely. Set it to only rotate left and right. It's on the top centre bar with the 3 buttons, click the <-> one.

Last edited by jontmy00 (2012-07-07 20:12:50)


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#3 2012-07-07 21:01:27

pfred
New Scratcher
Registered: 2012-07-07
Posts: 2

Re: Problem with: if on edge, bounce

You are an angel!  It worked perfectly!  Thanks a million.  I love this forum.

Offline

 

#4 2012-07-07 21:05:53

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Problem with: if on edge, bounce

Yes, you can also choose for it to not rotate at all, which is the third button.

Have fun and scratch on!


Hai.

Offline

 

#5 2012-07-08 02:37:19

pinnipediator
Scratcher
Registered: 2012-02-10
Posts: 500+

Re: Problem with: if on edge, bounce

I thought you had to have movement blocks after the bounce because the bounce just set it up?

Offline

 

#6 2012-07-08 02:45:27

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: Problem with: if on edge, bounce

pfred wrote:

You are an angel!  It worked perfectly!  Thanks a million.  I love this forum.

You're welcome.  smile


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#7 2012-07-08 06:51:33

pinnipediator
Scratcher
Registered: 2012-02-10
Posts: 500+

Re: Problem with: if on edge, bounce

It's a  good helpful forum, but it is looser than i'm used to.

Offline

 

#8 2012-07-08 09:12:08

ProgrammingPro01
Scratcher
Registered: 2011-07-30
Posts: 1000+

Re: Problem with: if on edge, bounce

You have to go to your sprite, and click the bottom button next to the sprites x and y.
If you're confused, the image below may help. It's the button circled that you need to click.

http://i.imgur.com/RZi6S.png


Bye 1.4!
http://www.reactiongifs.com/wp-content/uploads/2013/04/sobbing.gifhttp://25.media.tumblr.com/tumblr_mbfh6bIamQ1qky11ho1_500.png

Offline

 

#9 2012-07-09 15:44:26

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Problem with: if on edge, bounce

By default, Scratch sprites won't appear mirrored if they're pointing to the left.  With the rotation mode (as shown by the three buttons on the left of the diagram in ProgrammingPro01's post), you can choose full rotation, two-directional rotation, or no rotation for any sprite. 

The two-directional rotation option will display the mirror image of the sprite if it's facing to the left.  However, it won't be rotated; it will always remain pointing either straight to the left or right. 

You might also consider creating special left-facing and right-facing costumes for each fish if you want them to be displayed at an angle, and simply switch to the appropriate costume based on the value of the direction variable. 

Hope that helps.  It's cool for me to hear about a summer programming camp for Scratch; that's how I was first introduced to the language.  Good luck!

Last edited by amcerbu (2012-07-09 15:44:35)

Offline

 

Board footer