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) stepsNotice 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.
when gf clicked go to x:(0) y:(0) move (10) stepsBut wait! That just makes it end up 10 x position every time you click the green flag. Lame!
when gf clicked go to x:(0) y:(0) move (10) steps move (10) steps move (10) steps move (10) stepsuse a repeating c-loop and do THIS:
when gf clicked go to x:(0) y:(0) repeat (40) move (10) steps endPlay around with the repeating number. Cool, huh? Try replacing the "repeat" loop with "forever." Now it doesn't stop after moving a certain distance!
if on edge, bounceAdd it to the c-loop under move 10 steps. Suddenly, your object reflects off of the walls! ...upside-down. What causes this?
<if [space v] key pressed?>(this should be light blue and have pointy ends)
next costumein the "if < >" loop. Make sure your sprite has at least two costumes.
wait (1) secsunderneath "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) secsThere, all better! Now it changes without hardly pausing.
Last edited by Failord (2013-04-12 07:38:46)
Offline
Nice, that's how i usually think to... I think it's a sign of you learning how to program.
Nice post.
Regards,
CAA14
Offline
CAA14 wrote:
Nice, that's how i usually think to... I think it's a sign of you learning how to program.
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
Failord wrote:
CAA14 wrote:
Nice, that's how i usually think to... I think it's a sign of you learning how to program.
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! Example: "Do you know how you do this?"
LOL, sorry about that.
Regards,
CAA14
Offline
Hi!
Oh wait... I'm not a new Scratcher.
I like the guide. On the if space key pressed, add a question mark at the end.
Offline
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).
Offline
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