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

#1 2013-02-22 20:41:55

Failord
Scratcher
Registered: 2012-01-07
Posts: 53

Hello, new Scratchers!

Greetings from Failord, creator of the featured project Asteroid Avoider and other fun games and projects. I love tinkering with Scratch. Most of my projects I think of in my pondering time, and after a bit of thinking, blossom into awesome projects.

If you look at most of my projects(especially 1 sprite, 1 script ones), you will find that the scripting appears incredibly complex. For the most part, it actually is. It begs the question: "Will I be able to program like this? It's so big!"

Some advice to get you started:

Let's start with how scripts work. Think of what you want the sprite to do, first of all. Then you start putting scripts together. How? Try thinking of scripting like constructing a sentence. "When this happens, do this, then do this, and so on."

Start with things that are relatively simple. Try making an object move around.

when gf clicked
move (10) steps
Notice the object only moves a little. Why? You didn't program it do do more than nudge forward ten pixels. When you click rapidly on the green flag, the object scootches al the way over to the edge of the screen.

So how do you make it do what you want?

There are some basic steps to programming any project. Some may not be necessary for certain types of projects, but these are the ones that most games and animations need:

Resetting: Make the object return to desired settings before preceeding. Without programming this in, the only way to do it is save the project with the desired settings and reopen it when you want to reset it. This is incredibly painstaking. Instead, to give your object room to move 10 steps again, put this in:

when gf clicked
go to x:(0) y:(0)
move (10) steps
But wait! That just makes it end up 10 x position every time you click the green flag. Lame!

That brings me to the next point:

Repeating: It would get tedious to drag a whole bunch of movement scripts and stack them on top of each other, plus it stops after a while. So instead of this:

when gf clicked
go to x:(0) y:(0)
move (10) steps
move (10) steps
move (10) steps
move (10) steps
use a repeating c-loop and do THIS:

when gf clicked
go to x:(0) y:(0)
repeat (40)
 move (10) steps
end
Play around with the repeating number. Cool, huh? Try replacing the "repeat" loop with "forever." Now it doesn't stop after moving a certain distance!

Still pretty simple, right? But there's still the problem of the screen-edge barrier. In the movement section, you will find a handy little script labled,

if on edge, bounce
Add it to the c-loop under move 10 steps. Suddenly, your object reflects off of the walls! ...upside-down. What causes this?

Rotation: If you want it to be right-side up, click the little double arrow next to the sprite display above the scripts. If the little display flips back and forth once, you did it right.

Play with the blue line to change the way the sprite is facing. Notice it affects the way it moves with the move 10 steps script, combined with the bounce script.

Sensing: The bouncing script is next to impossible to program with regular scripting.

Note the c-loop script under the control section, the one that says, "if < >." Try putting it in the repeat loop with the two movement scripts. Go to the sensing section, and fill the hole(< >) in the "if < >" loop with a < > block. These sensing blocks are called Boolean, by the way. I recommend

<if [space v] key pressed?>
(this should be light blue and have pointy ends)

Now go to the looks section and put

next costume
in the "if < >" loop. Make sure your sprite has at least two costumes.

Note that the costume changes really fast and it's hard to get it to "land" on the right costume. To remedy this, go back to control and put

wait (1) secs
underneath "next costume." When you press space or whatever it will pause for a second before moving. To reduce this, use a period and make it

wait (0.1) secs
There, all better! Now it changes without hardly pausing.

So that's basic groundwork. Continue to expiriment and expand your horizons, and soon you'll be a great Scratcher!

-PS if this post helps you, please let me know! And if you get down the road and get a project front paged(not talking about Newest Projects), please let me know!

Thanks for reading and welcome again to Scratch!

Signed,

Failord

Last edited by Failord (2013-04-12 07:38:46)

Offline

 

#2 2013-02-22 20:47:37

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: Hello, new Scratchers!

Nice, that's how i usually think to... I think it's a sign of you learning how to program.  smile

Nice post.

Regards,

CAA14

Offline

 

#3 2013-02-23 22:21:32

Failord
Scratcher
Registered: 2012-01-07
Posts: 53

Re: Hello, new Scratchers!

CAA14 wrote:

Nice, that's how i usually think to... I think it's a sign of you learning how to program.  smile

Me learing how to program? I already know how to! That's where this post came from in the first place, to help get new Scratchers going.

...sorry if I was being a bit rude.

Offline

 

#4 2013-02-23 23:02:32

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: Hello, new Scratchers!

Failord wrote:

CAA14 wrote:

Nice, that's how i usually think to... I think it's a sign of you learning how to program.  smile

Me learing how to program? I already know how to! That's where this post came from in the first place, to help get new Scratchers going.

...sorry if I was being a bit rude.

Oh no! You misunderstood me! I meant "you" as in general, not you personally!  big_smile  Example: "Do you know how you do this?"

LOL, sorry about that.  smile

Regards,

CAA14

Offline

 

#5 2013-02-25 20:20:53

Failord
Scratcher
Registered: 2012-01-07
Posts: 53

Re: Hello, new Scratchers!

Okay. Just straightening things out...  wink

Offline

 

#6 2013-02-25 21:47:01

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Hello, new Scratchers!

Hi!
Oh wait... I'm not a new Scratcher.   tongue
I like the guide.  On the if space key pressed, add a question mark at the end.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#7 2013-02-28 13:36:11

gottyk
New Scratcher
Registered: 2013-02-28
Posts: 12

Re: Hello, new Scratchers!

you guys say weird stuff so your'e not ban . that's lame do be honest

Offline

 

#8 2013-02-28 14:03:06

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Hello, new Scratchers!

gottyk wrote:

you guys say weird stuff so your'e not ban . that's lame do be honest

Actually, we work really hard to make sure the site stays friendly and welcoming.  It's really important that people communicate here respectfully.  You might want to check out Community Guidelines (at the bottom of every page) and the forum posting guidelines (look at the top of the forum section).


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#9 2013-04-02 23:18:58

Failord
Scratcher
Registered: 2012-01-07
Posts: 53

Re: Hello, new Scratchers!

gottyk wrote:

you guys say weird stuff so your'e not ban . that's lame do be honest

What do you mean? Was it something I said? This post was for new Scratchers...

Offline

 

#10 2013-04-03 18:41:19

7734f
Scratcher
Registered: 2010-12-23
Posts: 500+

Re: Hello, new Scratchers!

Failord, this is what the key looks like by the way:

<key [space v] pressed?>
What you had was:

Code:

[scratchblocks]
<if [space v] key pressed?>
[/scratchblocks]

With regards,

               ~7734f


http://internetometer.com/image/38992.png   http://i37.tinypic.com/2qixx6c.png

Offline

 

#11 2013-04-12 07:40:13

Failord
Scratcher
Registered: 2012-01-07
Posts: 53

Re: Hello, new Scratchers!

7734f wrote:

Failord, this is what the key looks like by the way:

<key [space v] pressed?>
What you had was:

Code:

[scratchblocks]
<if [space v] key pressed?>
[/scratchblocks]

With regards,

               ~7734f

Tried it. Still messed up. What the heck...?!? I mean, I typed in the exact same thing the fiirst time but copied and pasted the make sure!

Offline

 

Board footer