Discuss Scratch

TECH_TRASH
Scratcher
6 posts

What is the opposite of abs of block in scratch

On one of my recent projects I used abs of block that worked when it the sprite faced 90 degrees when I tried to move it negative 90 degrees it didn't work I switched the order and even tried negative numbers


Last edited by TECH_TRASH (June 5, 2022 10:09:58)

Jlerpy
Scratcher
1000+ posts

What is the opposite of abs of block in scratch

I'm unclear what you're trying to achieve.
idkhow2type
Scratcher
100+ posts

What is the opposite of abs of block in scratch

0-absofvariable
?
RT_Borg
Scratcher
1000+ posts

What is the opposite of abs of block in scratch

Hi TECH_TRASH,

abs (short for “absolute value”) takes a number and tells you how big the number is, without caring whether it's a negative number.

So abs (7) = 7.
and abs (-7) = 7.

It basically just strips off negative signs.

If you're looking to take a variable and make it the opposite (turn positive into negative, and negative into positive) the easiest way is:

0-somevariable

or

-1*somevariable

Is that what you're looking for?

– RT_Borg
TECH_TRASH
Scratcher
6 posts

What is the opposite of abs of block in scratch

@RT_Borg and @idkhow2type
This really helped my project thanks
elh201108
Scratcher
1 post

What is the opposite of abs of block in scratch

Is there a block that can switch both a positive to a negative and a negative to a positive?

Last edited by elh201108 (March 17, 2024 19:20:37)

SpyCoderX
Scratcher
1000+ posts

What is the opposite of abs of block in scratch

elh201108 wrote:

Is there a block that can switch both a positive to a negative and a negative to a positive?
That is the “abs of ()” block, but try not to Necropost on old posts. Thanks!

Powered by DjangoBB