They are kind of like boxes.
You can put something into the box, and then see what it is later.
If you want to put anything else in, then the first thing that was in the box is removed.
Hope this little analogy helps!
Offline
Currently I'm working on a quite good 1v1 fighting game, and I have some variables. Every character has HP and MP that signs informations the player needs, but I can't place them. When i put them to their place and i save and quit and then open it again they are back at the place they appeared. I can't find anything to place them finally and without it, it'll be a bit [removed], because you won't be able to see some of the skill buttons and stuff. Could you help me in my issue?
Last edited by Paddle2See (2009-07-26 05:11:57)
Offline
Soranhawke wrote:
Currently I'm working on a quite good 1v1 fighting game, and I have some variables. Every character has HP and MP that signs informations the player needs, but I can't place them. When i put them to their place and i save and quit and then open it again they are back at the place they appeared. I can't find anything to place them finally and without it, it'll be a bit [removed], because you won't be able to see some of the skill buttons and stuff. Could you help me in my issue?
There have been some bugs with the Show/Hide blocks. Try saving the project with the variables showing. I think Scratch gets confused when the variables are hiding when it is saved or shared.
Offline
nmhawley wrote:
What about sliding variables
These are just controls to let the user easily set the value.
They can be used in conjunction with variable setting blocks to create very advanced projects.
Offline
me too!
Offline
The technical term for "variable" is a number that can change or vary. You probably know to find the area of a rectangle or square, you do the simple equation length x width. If you replace the length with an L and width with a W, you would see the equation L x W. L still means length, it just looks different. W still means width, it just looks different. Gee, this is harder to explain than I thought! Anyway, in this case length and width are two variables. Wow, I almost forgot a very important variable for this situation! Area is also a variable. Let's shorten it to A. Our new formula (equation) is L x W=A.
Offline
nmhawley wrote:
What about sliding variables
A sliding variable is one you can manually change.
Offline
Larry828 wrote:
Archmage, how would you construct the phrase "if touching 'ground' grounded = 1" using Scratch blocks?
"If" requires an insert with pointed ends. The "=" relationship is built within an insert with ROUNDED ends. I can build "grounded = 1" but I can't combine it with the "if" block.
IF TOUCHING |sprite4| (....assuming Sprite4 is the ground)
.........
<(grounded) = (1)>
but I can't combine those two blocks to express THEN.
(I tried to use the "blocks" at the bottom of this form but didn't succeed. When I previewed my result it wasn't what I intended, so I'll have to learn the syntax of using the blocks in these messages. I kinda got the blocks in there, but didn't know the syntax for filling the blank spaces with names of variables, names of sprites, and numbers.... Oh well, just another challenge....) :-)
I hope my verbal try made sense....
BTW, I was able to build your second set of commands.
IF <(grounded) = (1)>
BROADCAST |jump|
Thanks! Larry
P.S. it says Smilies are on, but my typed smilies never turn into graphical ones.... yet another challenge. :-)
PP.S. Even worse, when I previewed this message the messaging program substituted partial green blocks for my typed )> characters. I don't know how to retype it to prevent that, so I hope it's comprehensible. There must be an easier way. Or maybe I need to find a "pre-Scratch" language!! :-)
<( <=> )> it does have pointed ends dude
Offline
<change{Scrollx }by( 5 waaa i dont get it. HELP ME. i mean, i know the easy ones like score but i mean ones that contribute to the sprites movement. like that danny phantom on the frontpage. its hard to figure those out dang it! someone make a project on how to do it. thanks.
Offline
http://scratch.mit.edu/projects/greenflash/673855
Offline
pedroskivich wrote:
You can use it for a game like for ammo if you shoot whenever you shoot take away one and if it gets to zero you can't shoot.
How do you make it stop shooting? Please explain
Offline
Usmanproductions wrote:
pedroskivich wrote:
You can use it for a game like for ammo if you shoot whenever you shoot take away one and if it gets to zero you can't shoot.
How do you make it stop shooting? Please explain
Nevermind, I know now you do this:
<if> <( ammo <=> 0 )>
<hide> bullet
Offline
midnightleopard in the game Night Parkour how did you make your stick man fall when he wasn't touching black?
I am make a maze type game and can't get my sprite to fall of a ledge, instead it just stands mid air.
Please help!! I am desperate!
Thx
Offline
I'm not midnightleopard, but I'll try answering anyway.
Try the following script:
When Flag Clicked
forever
repeat until touching color [black]
change y by (-2)
endrepeat
You can change the value - the less it is, the faster the sprite will fall. Just don't go positive; your sprite will start flying.
Offline
Okay, first of all, thanks for looking at my project! Second of all, I actually used an old advanced trick I learned from a user called The-Genius. The script is[blocks]
<when green flag clicked>
<set{ Y velocity }to( <{ Y velocity }>
<forever>
<if><touching color[ black]
<set{ Y velocity }to( 1
<if><key[ Space ]pressed?>
<change{ Y Velocity }by( 15
<end>
<end>
<change{ y Velocity }by( -1
<change y by( <{ Y velocity }>
[/blocks]
but, if you want a simpler way to do that, try
[blocks]
<when green flag clicked>
<forever>
<repeat until><touching color[ black
<change y by( -3
<end>
<end>
[/blocks]
(The script above may need to be adapted to fit your project, but I think you could do it
Remember, if you want to see how a project works you can download it and open it in scratch! You could also try the new Expieremental Viewer to see the code online! Hope this helps!
Last edited by midnightleopard (2010-08-15 08:11:46)
Offline
A variable is a placeholder for numbers, letters, or strings. Strings are a group of letters. They can be used for score, and on/off switch, data in a computer, the position of a sprite, or anything that stored numbers/letters/strings can be used for.
Offline
Please note that this topic was originally posted 2007-08-16. I'm pretty sure both the forums and the Scratch application itself have gone through changes/updates since then so keep in that in mind.
Offline
Locomule wrote:
Please note that this topic was originally posted 2007-08-16. I'm pretty sure both the forums and the Scratch application itself have gone through changes/updates since then so keep in that in mind.
![]()
Indeed, there have been! I first started out using Scratch 1.1 back in July of 2007 - we had no lists, no hide/show variable blocks, and each variable had its own set of blocks. See how we have a dropdown list for each variable in the "change [variable] by [x]" and "set [variable] to [y]" blocks? Before, there wasn't: each and every block had its own blocks of the like
Offline