Discuss Scratch

Enderplays8
Scratcher
31 posts

adding in physics blocks

Can you add a gravity block to scratch? it would make platformer physics a WHOLE LOT easier. here is how it would work:
forever
if <not <touching [ground] ?>> then
repeat until <touching [ground]>
change [Y speed] by (-1)
change y by (Y speed)
end
end
end

the
<touching [ground] ?>
is because this block would add in a ground sprite into your project. it would be in a category called:
(black colour) Physics.
and, a number or text block also in the physics category called:
(scroll on sprite).
absolutely NO idea on how long it takes to enter it in in JavaScript.
NO IDEA AT ALL. also, when you add them in, (if you even DO add them in),
let me know!

cats are my favorite people
Mr_PenguinAlex
Scratcher
1000+ posts

adding in physics blocks

This is in the wrong topic, also, no support.

Enderplays8 wrote:

forever
if <not <touching [ground] ?>> then
repeat until <touching [ground]>
change [Y speed] by (-1)
change y by (Y speed)
end
end
end
You just gave a workaround, so I doubt this would be added.

Last edited by Mr_PenguinAlex (June 17, 2019 22:26:22)


themasterofme
Scratcher
71 posts

adding in physics blocks

use the custom block
define gravity blocks
...

Algorithmic boomer with the triangle construction trilogy.
DaEpikDude
Scratcher
1000+ posts

adding in physics blocks

Wasn't there supposed to be a physics extension at some point?

Anyway, I think that for simple platformer physics it's fairly easy to recreate with a simple gravity variable. (I mean, you basically gave the workaround yourself…)
And as for more complicated physics, well, would that really be used enough to warrant an entire extra main category being added?

And all the world over, each nation's the same,
They've simply no notion of playing the game.
They argue with umpires, they cheer when they've won,
And they practice beforehand, which ruins the fun!
Nambaseking01
Scratcher
1000+ posts

adding in physics blocks

Support.

If there was a block that said -

set gravity to (true or false)

- it would be really nice to create platformers.

Hey there! My name is Nammy. I'm a male Forum Helper and Scratch Wiki Editor.
Profile | Test Account | Talk with me here! | Griffpatch is quitting Scratch?!
ResExsention
New to Scratch
1000+ posts

adding in physics blocks

Nambaseking01 wrote:

Support.

If there was a block that said -

set gravity to (true or false)

- it would be really nice to create platformers.

Uh, no…

You can just do:

forever
if <(gravity_enabled) = [1]> then
whatever gravity script :: grey
end
end

Infrequently active.

It feels weird to see how far we've come. I hope you're well, wherever you are!
Nambaseking01
Scratcher
1000+ posts

adding in physics blocks

ResExsention wrote:

~snip~
Uh, no…

You can just do:

forever
if <(gravity_enabled) = [1]> then
whatever gravity script :: grey
end
end

Uhh, I was just giving an example of what the block would look like?

Even if people used that script, you will have to define the variable, how it works, etc… Still giving support.

Hey there! My name is Nammy. I'm a male Forum Helper and Scratch Wiki Editor.
Profile | Test Account | Talk with me here! | Griffpatch is quitting Scratch?!
Dragonlord767
Scratcher
1000+ posts

adding in physics blocks

Apparently @Grifpatch has made one. It would definately be doable.

no signature plz
Nambaseking01
Scratcher
1000+ posts

adding in physics blocks

Dragonlord767 wrote:

Apparently @griffpatch has made one. It would definately be doable.

Not only griffpatch made a gravity system, also tons of other Scratchers and New Scratchers.

I fixed your grammar btw. ;P

Last edited by Nambaseking01 (June 23, 2019 11:58:59)


Hey there! My name is Nammy. I'm a male Forum Helper and Scratch Wiki Editor.
Profile | Test Account | Talk with me here! | Griffpatch is quitting Scratch?!
Enderplays8
Scratcher
31 posts

adding in physics blocks

GEEZ GUYS, THNX!! but, the physics blocks would just reduce lag. because normal platformers have more blocks, but the
(Gravity)
block reduces lag ‘cuz it doesn’t use AS MUCH blocks!

cats are my favorite people
Enderplays8
Scratcher
31 posts

adding in physics blocks

themasterofme wrote:

use the custom block
define gravity blocks
...
WELL,
Gravity
is just a SUGGESTION.
Hmm? what's that Gravity Block?
Gravity
I think scratch team should add me . there could me many uses for me, and other of my type . it looks like they have some things to say, too .
hitbox width () length ()
wall/slope detection
NPC/ENEMY ACTION # of actions ()
i'm a hitbox detector. i'll got to any sprite i'm in, and i'll be the size of my two number-or-text slots. I also don't take variables .
i'm a slope/wall detector. I detect if the player is touching a wall, or walking up a slope. I even detect ceiling collision and ground collision .
i'm an NPC/ENEMY action randomizer. I will make enemies in platformers and NPCs for simulators easy. enter the number of actions in my number-or-text slot to determine what kind of enemy/NPC it is.
so, there are some more of my PHYSICS category blocks.

cats are my favorite people
hellothisisnotnew
Scratcher
29 posts

adding in physics blocks

set gravity to (0)
hellothisisnotnew
Scratcher
29 posts

adding in physics blocks

Suggestion for physics blocks:
set gravity to (0) by (2.5)
run simulation
samq64
Scratcher
1000+ posts

adding in physics blocks

I'm not sure if someone already mentioned this, but Griffpatch made an editor physics extension, it can be found here.

Last edited by samq64 (June 16, 2021 13:21:36)

Enderplays8
Scratcher
31 posts

adding in physics blocks

Enderplays8 wrote:

Can you add a gravity block to scratch? it would make platformer physics a WHOLE LOT easier. here is how it would work:
forever
if <not <touching [ground] ?>> then
repeat until <touching [ground]>
change [Y speed] by (-1)
change y by (Y speed)
end
end
end

the
<touching [ground] ?>
is because this block would add in a ground sprite into your project. it would be in a category called:
(black colour) Physics.
and, a number or text block also in the physics category called:
(scroll on sprite).
absolutely NO idea on how long it takes to enter it in in JavaScript.
NO IDEA AT ALL. also, when you add them in, (if you even DO add them in),
let me know!
i am tea

cats are my favorite people
ScolderCreations
Scratcher
1000+ posts

adding in physics blocks

This would be very difficult to program in JavaScript, and the ST might not have the time to code something that complicated. How do you propose they will be able to do this in a timely fashion?

Crispydogs101
Scratcher
1000+ posts

adding in physics blocks

Support. This can be used a lot and can be great for games where they have gravity.
I also think these blocks are professional which means it can teach kids the basics of gravity in games or coding. Which is a great thing to teach children!

Although one thing. Is this going to be hard to use when you are a new scratcher? Prob is but they will learn. Maybe as an extension would be better.

Last edited by Crispydogs101 (May 5, 2023 19:11:37)


Hey! Look at this DTA!
Hej! My username is @Crispydogs101. I like listening to music, playing games, and more!
Sarah and duck, Pete the cat, Pegboard nerds, Tokyo machine, FORZA FAN!! Be High contrast Blue Be rich
Enderplays8
Scratcher
31 posts

adding in physics blocks

I haven’t seen this post in 2 years and now I’m seeing it and its kinda old now like you can just go to a physics project and copy it
Or use a game engine with visual coding like scratch

cats are my favorite people
Pfooster012
Scratcher
1 post

adding in physics blocks

I keep trying but if I add gravity my X movement does not work. Can anyone help me?
Dyanoa
Scratcher
100+ posts

adding in physics blocks

Enderplays8 wrote:

Can you add a gravity block to scratch? it would make platformer physics a WHOLE LOT easier. here is how it would work:
forever
if <not <touching [ground] ?>> then
repeat until <touching [ground]>
change [Y speed] by (-1)
change y by (Y speed)
end
end
end

the
<touching [ground] ?>
is because this block would add in a ground sprite into your project. it would be in a category called:
(black colour) Physics.
and, a number or text block also in the physics category called:
(scroll on sprite).
absolutely NO idea on how long it takes to enter it in in JavaScript.
NO IDEA AT ALL. also, when you add them in, (if you even DO add them in),
let me know!
You just gave a workaround lol. Why would the ST add something if it had an easy workaround?

Captain-Doggo's alt
Very complicated math algorithm| I am a Furry| �
This siggy is protected with SiggyProtect™ meaning that It can't be eaten
Peaceful and quiet snow

Powered by DjangoBB