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

#1 2010-10-27 21:20:29

enthusiest
New Scratcher
Registered: 2010-10-27
Posts: 1

help with a basic scratch design.

hello, i am new to scratch and for my intro to comp sci 101 course, i need to create a basic scratch sketch. i am still quite new and would appreciate all the help i could get. i would like to make a simple scratch  script where my sprite moves left and right infinitely except when i put another object in his way. thanks so much!

Offline

 

#2 2010-10-28 14:14:23

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: help with a basic scratch design.

Try using the "repeat until" loop from the "control" category, then put a "touching []?" block from "sensing" in the diamond-shaped cutout. Add the main part of the script (moving left or right) You could put other conditions into the cutout instead - for example, if you wanted the sprite to stop moving when its x position was equal to an amount, or when the mouse is down  smile

Try stacking two of the "repeat until" loops that you have put blocks in (one for moving left, one for moving right) together. You could also put a loop from "control" around this stack, to make the sprite keep doing this, either infinitely (using the "forever" loop), a certain number of times (using the "repeat (10)" loop - you can change the number to your needs), or until another condition is met  smile


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

Board footer