<when green flag clicked>First of all I only know how to do it with global variables, but anyways: If you havent changed the names of the costumes, they should be like "costume1", "costume2", etc:
so you can clearly see the Costume #. Next, there is a little block in Looks ( I think the type of block is a reporter)that says Costume #.
So here is an example of the blocks you'd need for an alien game or something where every time you hit a spacecraft you get 10 pts. This would be a script for the spacecraft, which would have 2 costumes, a regular costume and a blown-up one:
[blocks]<when green flag clicked>[/blocks]
[blocks],<if><<(costume # <=> 2 )[/blocks]
(This MAY not look good, it's my 1st time using blocks in the forum.)
You get the idea. When green flag clicked, if costume # = 2, change score by 10.
Which means:if it is in its blown-up costume, you get 10 pts.
Hope this helps!
Variables are Scratch's way of remembering different numbers, digits, values or key combos for a while. Basically, if you set variable A to on, then it'll stay as "on" until it is changed. This is useful for C blocks (like If ___), and making Scratch be able to ask multiple questions, and save answers to all those questions, not just the first one.
A variable is just what it sounds like. It varies.
For the example, let's name the variable "Score."
Let's pretend that you are making a maze game. Whenever you get to the next level, you want to get 10 points.
You do this:
change [score v] by (1)The possibilities for using variables are infinite. What I would recommend is to look at the example projects that use variables and look at how they use them.
Is there a site where I can find some php programming tutorials?...I guess there are a lot more useful information about variable to be found there too.
please post here if someone finds such a resource
Hey i saw this topic and thought i could post my question here. i cant post a topic yet idk why. anyway, i'm making a pokemon simulator with advance damage calculation, but when i tst it, part of the equation turns red. i thought it could be because i dont have parentheses () but i dont know how to add them. help please?
maybe you divided by 0.
Hello, I am still new to Scratch. In Tech class, we have to create a game called "MadLibs."
I am not sure if we are able to put the variables in places that suits us best. For example, I have some 'fill-ins' that I want the variables to stay in place. But, whenever I open this game the next day, the variables will be out of place.
This is the game: http://scratch.mit.edu/projects/Cheese-Dragon/2494777
It is not finished. Thanks for hearing me out. And if you can help, thank you very much!
well if your making a game you think this,
when gf clicked
wait until <touching [? v]>
change [lives v] by [-1]
no its like this.
when gf clicked forever wait until <touching [? v]> change [lives v] by [-1] repeat (5) times show wait (.2) hide end when gf clicked wait until <(lives) = (0) hide stop allvariables are bridges that connect scripts.
Forgive me if this has been answered already, I'm new Scratch and to this site.
I know you can get variables to stay where you've put them if you make them visible. The problem is they then show up on the opening screen. Please can someone tell me if there is a way round this?