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

#1 2009-11-19 07:46:03

Brass45
Scratcher
Registered: 2009-05-03
Posts: 500+

How to move(digitally)ANYTHING!!!

Hello,Brass45 here, and before I go into this topic let me explain why i'm doing it(i'll make it short). Anyway,I have a younger cousin in scratch,but he has not posted any projects because of the fact that he doesn't know how to make any moving scripts;that is, scripts that let you move with the arrow keys.It's not hard at all.I'll post the scripts,then explain how they work:
[blocks]
<when green flag clicked>
<forever>
<if><key[ whatever,arrows or ASWD ]pressed?>
<change x by( 3
(repeat the above four times for X and Y)
[/blocks]

now,how this works is simple.[blocks]<when green flag clicked>[/blocks]is a hat block,which detects when to start the script,in this case when you press the green flag.The[blocks]<if>[/blocks]                block checks to see if a condition is true,in this case whether a certain key is pressed or not,and the[blocks]<forever>[/blocks]ensures that it keeps on checking.In this case,if the condition is true,then it will move the sprite three units to the right.If you make four scripts,each with either a positive or negative X or Y amount tn accordance to the key pressed,then you can move in any direction!

Well,thanks for viewing,and tell me how this script works.Keep on scratching!


http://img412.imageshack.us/img412/4593/ubd1591.png<--Our website(click)
http://static.zooomr.com/images/8884671_b196719ffa_o.png<--If this image looks interesting,then click it to see an exclusive sneak peak of Evil Strings newest game:DarkLight

Offline

 

#3 2009-11-20 16:13:06

Brass45
Scratcher
Registered: 2009-05-03
Posts: 500+

Re: How to move(digitally)ANYTHING!!!

What do you mean,"how can that happen"???


http://img412.imageshack.us/img412/4593/ubd1591.png<--Our website(click)
http://static.zooomr.com/images/8884671_b196719ffa_o.png<--If this image looks interesting,then click it to see an exclusive sneak peak of Evil Strings newest game:DarkLight

Offline

 

Board footer