Saturday, May 31, 2014

Let's write a small Scratch program from scratch hehe :-)

If you've never used "Scratch" before, head over to "http://scratch.mit.edu/" and click on "Join Scratch" to open an account.  You don't have to, but all your hard work will be lost if you're not signed in, and who wants that eh?
Now you're signed in, click on the "Create" button to start a new project, and guess what: you get the Scratch Cat in the middle of your "backdrop" (the place your project will run in).
You can even click on the green flag to run your program, but guess what: it won't do anything :-).

So let's make it do something.
This would be a good time to read the "Getting Started" tips you get by clicking on the "?" question mark near the top right of your Scratch page (you are in the Scratch Editor page if you just clicked on "Create").

If you're done reading tips or want to just jump in and write your first program (or script) let's go on :-)
We're going to make the cat follow the mouse.
Cats have been chasing mice since forever so this is nothing new and is also very useful, both to feed the cat and in games, eh?You can see that the cat "Sprite" is already selected, so everything we do will apply to it.
Drag the "point towards" motion block onto the "Scripts area".
Click on the little down-arrow at the right of the block and select "mouse pointer".
As you can expect, this will make the cat turn towards the mouse pointer.
Click on the green flag and you'll see that still nothing happens :-(
That's OK and that's because the program needs to be told you want it to start.
You do that by clicking on the "Events" button near the top-middle of the screen.
This is where the "do something when something happens" blocks are.
Drag the  button on top of the "point-towards" block.  It should "lock in place".
Let's test it now: click on the green flag and voila: the cat is pointing towards the mouse.
Let's make it move towards the mouse.
Click on the "motion" button near the the top-middle of the screen and drag the "move 10 steps" block to the bottom of the script.
Test it now. Click repeatedly on the green flag and you'll see that each time the cat get's closer. YEY!
But this means the mouse has to be on the green flag so you can click on it again and again... not much fun.
So let's tell the script to keep doing it by itself once we start it.

Click on the "Control" button near the top-middle of the screen.
Drag the "point towards" block down and away from the top block.
Now drag the "forever" block on top of the movement script until the white outline shows that the "forever" block will surround both blue blocks.
Now drag the forever block to the bottom of the "When green flag clicked" block and you should get something like this:
If you now click on the green flag to start the script you'll see that the cat follows your mouse as much as it can and would eat it for sure if only you had written the program to let it do so.
You can experiment by changing the 10 in the "move 10 steps" block to smaller or larger numbers and see what happens.
Next time we can give it a mouse to eat :-)


Friday, May 30, 2014

Featured project #2

Lets get on the something a bit more complicated...
How about Palindrome detector?
How does it work?
It uses a loop, which loops half the amount of letters in the answer.
Why half?
It will check from each side, and if both sides found the same letters/numbers as the other side, it is a palindrome.
And if it finds one letter not in common, it skips to saying that this string is not a palindrome, if through all the loops it works, it is a palindrome!
Cheers, Codegirl101

Tuesday, May 27, 2014

Featured Project #1

Today's Featured project is Smoke Effect. (By me of course)
How did I make it?
I made it using clones.
Why didn't I use stamping?
With stamping I cannot control what the stamps do. I just stamp things on the screen there permanently.
Why does the smoke have effects?
They have many effects, like color, ghost, pixel, etc.
In this case, the most important is ghost effect.
Why are you deleting the clones, I mean, they fade anyway?
Scratch cannot take too many clones, so I have to delete it for the smoke to work long - term

Sunday, May 25, 2014

Bienvenue a mon blogue

Bonjour, je suis Codegirl101, et je vais vous apprends la programmation.
Eh bien, tout d'abord. Pourquoi je me nomme Codegirl101?
Si vous ne connaissez pas déjà moi, c'est mon nom d'utilisateur sur scratch.
Que-est que c'est scratch?
C'est un langage de programmation graphique, et si vous voulez l'apprendre, ne vous inquiétez pas. Vous n'avez pas besoin de télécharger quoi que ce soit, juste aller a scratch.mit.edu, et vous pouvez commencer à programmer!
Par ailleurs, vous devez créer un compte pour enregistrer votre travail.

Je vais aussi enseigner d'autres langages de programmation.

Si vous avez des questions au sujet de la programmation, ou voulez que je vous parler d'une autre langue, n'hésitez pas à commenter et je ferai de mon mieux pour vous aider avec votre situation.

Cheers, Codegirl101

Friday, May 23, 2014

Welcome to my blog

(English)
Hello, I am Codegirl101, and I will be teaching you programming.
Well, first things first. Why do I call myself Codegirl101?
If you don't already know me, that is my username on scratch.
What is scratch?
It's a graphical programming language, and if you want to learn it, don't worry. You don't have to download anything, just go to scratch.mit.edu, and you can start programming!
By the way, you should make an account to save your hard work.

I will also be teaching some other programming languages.

If you have any questions about programming, or want me to tell you about another language, feel free to comment and I will try my best to help you with your situation.

Cheers, Codegirl101