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

#1 2009-11-12 19:26:49

GregoriousX
Scratcher
Registered: 2009-11-12
Posts: 1

scratch movement

how do i make my character go on without making it go on forever like just amke it stop when im not pressing any buttons<move(  )steps>

Offline

 

#2 2009-11-12 19:45:32

Ralphjos
Scratcher
Registered: 2009-10-10
Posts: 100+

Re: scratch movement

When flag clicked
Forever if Key Pressed
Change X by (number) OR move Steps
End If


    Regards,
       Ralphj
os


http://i33.tinypic.com/2dt3j9j.gif

Offline

 

#3 2009-11-12 19:53:17

cocoanut
Scratcher
Registered: 2007-07-10
Posts: 1000+

Re: scratch movement

Here's how I prefer to do it:
http://img687.imageshack.us/img687/7681/scripts.gif

These scripts tell the computer:
Hey, when the program starts, do this:
Keep on checking if this key is pressed.
If this key is pressed, change this guy's direction to face right/left.
Then move some.

Last edited by cocoanut (2009-11-12 19:54:41)


http://i42.tinypic.com/20gyvif.jpgPlease leave a message at the beep.
Steam: Hellephant

Offline

 

#4 2009-11-12 20:02:52

Ralphjos
Scratcher
Registered: 2009-10-10
Posts: 100+

Re: scratch movement

cocoanut wrote:

Here's how I prefer to do it:
http://img687.imageshack.us/img687/7681/scripts.gif

These scripts tell the computer:
Hey, when the program starts, do this:
Keep on checking if this key is pressed.
If this key is pressed, change this guy's direction to face right/left.
Then move some.

Use this if you want your character to be facing upside down when walking left. There is a button next to the costume of a sprite that allows you to change if you want it to view 360, 180, or 0. (Shown below) To prevent your character from turning upside-down when facing left, select the 180 view.

http://i34.tinypic.com/2dkemhk.jpg

    Regards,
       Ralphj
os

Last edited by Ralphjos (2009-11-12 20:04:15)


http://i33.tinypic.com/2dt3j9j.gif

Offline

 

#5 2009-11-12 20:10:12

cocoanut
Scratcher
Registered: 2007-07-10
Posts: 1000+

Re: scratch movement

Oh, yeah, I forgot to add the part about switching to the middle button there.


http://i42.tinypic.com/20gyvif.jpgPlease leave a message at the beep.
Steam: Hellephant

Offline

 

#6 2009-11-13 15:25:13

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: scratch movement

or, if you make it rotate in the game, go into the sprite's costumes, then click on copy. edit 1 of the costumes and at the top of the editor there should be a button that looks sort of like this. I<-->I (I can't take a picture because my CPU was set back to factory settings and scratch is un-installed) If anybody knows what I'm talking about please post a picture. then put this script.
[blocks]
<when green flag clicked>
<forever>
<if><key[ left arrow ]pressed?>
<switch to costume[ facing left ]>
<change x by( -10 )>
<end>
<end>
[/blocks]
and the same thing for right arrow with facing right for the costume and change x by 10 instead of  -10.


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

Board footer