I don't want to use the timer, so I'm using variables. When I try something like this:
<set{ Time }to( 8.00
<change{ Time }by( 0.01
It show the variable as 8.0 and every 10 clicks of testing, it shows up as 8.1.
Can anybody show me how to fix this or show me a new method besides using a timer block?
Plus, when there is 2 numbers after the decimals, the number goes past the white circle.
Offline
Hmmmmm... if that's exactly what you're doing, I don't see how it messes up.
This sounds more like a bug with Scratch.
For a different method, you can try getting rid of the decimal point, so 8.00 becomes 800 and 0.01 becomes 1.
Offline
Jonathanpb wrote:
Hmmmmm... if that's exactly what you're doing, I don't see how it messes up.
This sounds more like a bug with Scratch.
For a different method, you can try getting rid of the decimal point, so 8.00 becomes 800 and 0.01 becomes 1.
I might try that, but it won't look as good I thought it will be. Thanks!
Offline
Scratch's variables aren't that great at showing longer numbers... but I didn't know it was as simple as that.
That's why I use a list to compute numbers.
Offline
I still don't get the variables. This is confuzzling. Help. =}
Offline
8.00 maybe looked at as a decimal.8.00 can also be 8.0 or 8. Since you put 8.00, the computer must have thought that you wanted a decimal so it didn't put 8, but because 8.0 is a also 8.00 and the extra 0 wasn't really needed (to computer) it must have made it 8.0. I doubt there's a way to make a time variable (for now). I suggest adding this to 'Suggestions'.
Offline
nightangel wrote:
I still don't get the variables. This is confuzzling. Help. =}
Even though variables sound fancy, they're just values. They're normally numbers, but you can set them to letters and words also.
Last edited by Jonathanpb (2009-12-17 23:34:17)
Offline
Jonathanpb wrote:
nightangel wrote:
I still don't get the variables. This is confuzzling. Help. =}
Even though variables sound fancy, they're just values. They're normally numbers, but you can set them to letters and words also.
![]()
I know that they're numbers and values, it's just what is the purpose of them. Do they help or make your game harder and even more confusing for people? If that's the case then I don't want to use them.
Offline
nightangel wrote:
Jonathanpb wrote:
nightangel wrote:
I still don't get the variables. This is confuzzling. Help. =}
Even though variables sound fancy, they're just values. They're normally numbers, but you can set them to letters and words also.
![]()
I know that they're numbers and values, it's just what is the purpose of them. Do they help or make your game harder and even more confusing for people? If that's the case then I don't want to use them.
All variables do are store values. What you do with them is up to you.
You can use variables to:
-Make games with levels
-Make string art
-Make complex simulations
And lots of other things!
To make levels, all you need to do it set a condition. If you need to touch a certain sprite to go to the next level, you could use variables.
For example:
[blocks]
<when green flag clicked>
<forever>
<if><touching[ level end
<change{ level }by( 1
[/blocks]
You can change the value of the variables too. You can use them as references. For example, lets say you have a game with a boss and you have a variable for what level you're on.
You can use the value of the variable to tell the boss when to appear. If you only wanted the boss to appear on level ten, you would use
[blocks]
<when green flag clicked>
<forever>
<if><( <{ level }> <=> 10 )>
<show>
[/blocks]
Just a couple of simple things that demonstrate the power of variables!
Offline
greenflash wrote:
nightangel wrote:
Jonathanpb wrote:
Even though variables sound fancy, they're just values. They're normally numbers, but you can set them to letters and words also.![]()
I know that they're numbers and values, it's just what is the purpose of them. Do they help or make your game harder and even more confusing for people? If that's the case then I don't want to use them.
All variables do are store values. What you do with them is up to you.
You can use variables to:
-Make games with levels
-Make string art
-Make complex simulations
And lots of other things!
To make levels, all you need to do it set a condition. If you need to touch a certain sprite to go to the next level, you could use variables.
For example:
[blocks]
<when green flag clicked>
<forever>
<if><touching[ level end
<change{ level }by( 1
[/blocks]
You can change the value of the variables too. You can use them as references. For example, lets say you have a game with a boss and you have a variable for what level you're on.
You can use the value of the variable to tell the boss when to appear. If you only wanted the boss to appear on level ten, you would use
[blocks]
<when green flag clicked>
<forever>
<if><( <{ level }> <=> 10 )>
<show>
[/blocks]
Just a couple of simple things that demonstrate the power of variables!
Ok, Thank you that helps a lot.
I'm sorry I'm so stupid.
Offline