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

#1 2012-09-03 09:15:52

legobob23o
Scratcher
Registered: 2012-06-22
Posts: 500+

Move Straight While Turning, Bounce On Edge Walkthrough

I thought I'd post this because you may have been wondering

Here's my way of doing it:

point in direction (90 v)
go to x: (0) y: (0)
forever
  repeat until <touching [edge v]?>
    turn cw (15) degrees
    change x by (10)
  end
  repeat (10)
    turn ccw (15) degrees
    change x by (-10)
  end
  repeat until <touching [edge v]?>
    turn cw (15) degrees
    change x by (10)
  end
  repeat (10) 
    turn cw (15) degrees
    change x by (10)
  end
Have fun with the bouncing sprite! And as usual, Scratch On!

Offline

 

#2 2012-09-03 09:18:06

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

Re: Move Straight While Turning, Bounce On Edge Walkthrough

legobob23o wrote:

I thought I'd post this because you may have been wondering

Here's my way of doing it:

point in direction (90 v)
go to x: (0) y: (0)
forever
  repeat until <touching [edge v]?>
    turn cw (15) degrees
    change x by (10)
  end
  repeat (10)
    turn ccw (15) degrees
    change x by (-10)
  end
  repeat until <touching [edge v]?>
    turn cw (15) degrees
    change x by (10)
  end
  repeat (10) 
    turn cw (15) degrees
    change x by (10)
  end
Have fun with the bouncing sprite! And as usual, Scratch On!

There's a better way to do it with velocities.  wink


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

Offline

 

Board footer