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

#1 2011-03-10 06:30:09

misse
New Scratcher
Registered: 2011-02-09
Posts: 14

It wont move!

I have tried to follow a tutorial "http://www.scratch.mit.edu/ext/youtube/?v=u13BSy5rCWI" but when i have made all the scripts, it wont work, any help?

- set "x" to 0.
- set "max speed" to 20.
- forever
- if left arrow key pressed and abs of "x" < "max speed".
- change "x" by 2 (and -2)

and the same with right arrow key.

Offline

 

#2 2011-03-10 10:56:43

Sunrise-Moon
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: It wont move!

Is the bottom one changing a variable, or the actual x position? Also, is the "and -2" actually in the bottom block, or what? If it is, 2 + -2 cancels itself out, meaning it'll shake, but not move.


http://i1067.photobucket.com/albums/u427/HulKDzN/RebornBlade.png

Offline

 

#3 2011-03-10 13:07:47

misse
New Scratcher
Registered: 2011-02-09
Posts: 14

Re: It wont move!

x is my variable and i made scrips for left arrow key and right arrow key. One of them is set to -2 (changing variable) and the other one is set to 2.
i want them to change by absolute value x < max speed (witch also is a variable)

Offline

 

#4 2011-03-10 13:20:59

Wilmanx
New Scratcher
Registered: 2011-03-07
Posts: 8

Re: It wont move!

At the very end of the script, inside of the forever but outside an if, put "change x position by (x)" with the x being the variable, and x position being the actual x.

Offline

 

Board footer