Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Making a Number an Opposite
- Haydonni
-
4 posts
Making a Number an Opposite
I've been trying to get a number an opposite for a scrolling platformer level but I don't know how to. Pls Help
Last edited by Haydonni (Aug. 24, 2019 00:06:03)
- UnconstructivePoster
-
100+ posts
Making a Number an Opposite
Are you trying to get the opposite of a number? In that case:
Last edited by UnconstructivePoster (Aug. 24, 2019 00:18:30)
- hedgehog_blue
-
1000+ posts
Making a Number an Opposite
You can get the opposite of a number by subtracting it from 0
It looks like this in scratch blocks:
Why this works:
0 - number= -number ; if the number is positive it will be made negative, and if it is negative the two negatives will reduce to a positive. In both cases it is made the opposite.
Here are other ways of doing the same thing:
It looks like this in scratch blocks:
Why this works:
0 - number= -number ; if the number is positive it will be made negative, and if it is negative the two negatives will reduce to a positive. In both cases it is made the opposite.
Here are other ways of doing the same thing:
- deck26
-
1000+ posts
Making a Number an Opposite
Please don't necropost just to say thanks. WOW! Thanks
- catlover976
-
3 posts
Making a Number an Opposite
Thanks! (This can also help you with multiplayer scrolling platformer).
- deck26
-
1000+ posts
Making a Number an Opposite
See post above yours. Please don't necropost! Thanks! (This can also help you with multiplayer scrolling platformer).
- Michael_Studios
-
3 posts
Making a Number an Opposite
very helpful thank you
Last edited by Michael_Studios (Sept. 7, 2022 21:02:47)
- Spentine
-
1000+ posts
Making a Number an Opposite
See post above yours. Please don't necropost! very helpful thank you
- Discussion Forums
- » Help with Scripts
-
» Making a Number an Opposite