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
Here's how I prefer to do it:
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)
Offline
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.
Regards,
Ralphjos
Last edited by Ralphjos (2009-11-12 20:04:15)
Offline
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.
Offline