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

#1 2007-06-02 19:19:36

J053PH
Scratcher
Registered: 2007-06-02
Posts: 3

Work in progress

I just downloaded scratch today and well it's a very good program. So far I have been playing around with it and I got to a point where I couldn't get me guy to look the other direction when I pressed the left arrow. Any suggestions?

Here's the game URL: http://scratch.mit.edu/projects/J053PH/9629

Offline

 

#2 2007-06-02 21:40:50

weissjd
Scratcher
Registered: 2007-05-16
Posts: 64

Re: Work in progress

Instead of moving -10 steps and changing to a left-facing costume, it would be a lot simpler to change the sprite's direction to -90 when left arrow is pressed and move 10 steps. Since you have your sprite set to flip it will point in the right direction when you change its direction.

Offline

 

#3 2007-06-03 01:24:25

Macca
Scratcher
Registered: 2007-05-01
Posts: 18

Re: Work in progress

Also, I find a very useful thing to use is a 'forever if' loop:

  When 'arrow' clicked
    Forever if 'arrow' clicked
      Face 90 degrees
      Move 10 steps
    [endloop]
[endif]


~Macca

Offline

 

#4 2007-06-03 11:25:18

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Work in progress

The "when arrow clicked" block makes the forever-if loop unnecessary.
You'll avoid a lot of race conditions and other problems if you avoid forever constructs as much as you can.  All forever loops should have a wait in them.

Offline

 

Board footer