Discuss Scratch

Dancreatesgames
Scratcher
36 posts

Hitboxes

I'm trying to make it so that when my character hits something from below he just goes back down but the character is a apple and the stem is ruining my script I need a hitbox so he does not clip into a block
MineTurte
Scratcher
500+ posts

Hitboxes

Dancreatesgames wrote:

I'm trying to make it so that when my character hits something from below he just goes back down but the character is a apple and the stem is ruining my script I need a hitbox so he does not clip into a block
Actually I just made a hit box! You can use it if you'd like.

Link: https://scratch.mit.edu/projects/987157021/

If you need help implementing it I can help with that as well!

Hope this helps!

Last edited by MineTurte (March 21, 2024 14:48:50)


(pronouns are she/her). Advanced Alpha Game Studios Manager. Our website: https://aags2.w3spaces.com
This is JuniperActias. AKA Moth mommy. If I helped you out consider following Juni-Bug (my new account)!




If you found this secret, say uwu
Signature gradients here













SemiTruk
Scratcher
17 posts

Hitboxes

To make a simple hitbox you can make a new sprite and make it the same as the apple (expect remove the stem). Then you can implement code to make the hitbox invisible, follow the apple, and send events for things like hitting something.

Something like:

when green flag clicked
set [ ghost] effect to (100)
forever
go to [ *Insert Apple Name Here*]
end

and

when green flag clicked
forever
if <this thing happens> then
broadcast [ event or somethin]
end
end

“If at first you don't succeed, you fail.”
Dancreatesgames
Scratcher
36 posts

Hitboxes

MineTurte wrote:

Dancreatesgames wrote:

I'm trying to make it so that when my character hits something from below he just goes back down but the character is a apple and the stem is ruining my script I need a hitbox so he does not clip into a block
Actually I just made a hit box! You can use it if you'd like.

Link: https://scratch.mit.edu/projects/987157021/

If you need help implementing it I can help with that as well!

Hope this helps!
Yeah I need help implementing it
MineTurte
Scratcher
500+ posts

Hitboxes

Dancreatesgames wrote:

MineTurte wrote:

Dancreatesgames wrote:

I'm trying to make it so that when my character hits something from below he just goes back down but the character is a apple and the stem is ruining my script I need a hitbox so he does not clip into a block
Actually I just made a hit box! You can use it if you'd like.

Link: https://scratch.mit.edu/projects/987157021/

If you need help implementing it I can help with that as well!

Hope this helps!
Yeah I need help implementing it
Could you link your project then?

(pronouns are she/her). Advanced Alpha Game Studios Manager. Our website: https://aags2.w3spaces.com
This is JuniperActias. AKA Moth mommy. If I helped you out consider following Juni-Bug (my new account)!




If you found this secret, say uwu
Signature gradients here













Dancreatesgames
Scratcher
36 posts

Hitboxes

SemiTruk wrote:

To make a simple hitbox you can make a new sprite and make it the same as the apple (expect remove the stem). Then you can implement code to make the hitbox invisible, follow the apple, and send events for things like hitting something.

Something like:

when green flag clicked
set [ ghost] effect to (100)
forever
go to [ *Insert Apple Name Here*]
end

and

when green flag clicked
forever
if <this thing happens> then
broadcast [ event or somethin]
end
end
I'm not sure how that would work with my script
Dancreatesgames
Scratcher
36 posts

Hitboxes

MineTurte wrote:

Dancreatesgames wrote:

MineTurte wrote:

Dancreatesgames wrote:

I'm trying to make it so that when my character hits something from below he just goes back down but the character is a apple and the stem is ruining my script I need a hitbox so he does not clip into a block
Actually I just made a hit box! You can use it if you'd like.

Link: https://scratch.mit.edu/projects/987157021/

If you need help implementing it I can help with that as well!

Hope this helps!
Yeah I need help implementing it
Could you link your project then?
Yeah sure scratch.mit.edu/projects/986382335/ I am working on it currently though so something else might be broken when you refresh

Last edited by Dancreatesgames (March 25, 2024 14:39:28)

MineTurte
Scratcher
500+ posts

Hitboxes

Dancreatesgames wrote:

MineTurte wrote:

Dancreatesgames wrote:

MineTurte wrote:

Dancreatesgames wrote:

I'm trying to make it so that when my character hits something from below he just goes back down but the character is a apple and the stem is ruining my script I need a hitbox so he does not clip into a block
Actually I just made a hit box! You can use it if you'd like.

Link: https://scratch.mit.edu/projects/987157021/

If you need help implementing it I can help with that as well!

Hope this helps!
Yeah I need help implementing it
Could you link your project then?
Yeah sure scratch.mit.edu/projects/986382335/ I am working on it currently though so something else might be broken when you refresh
Do you mind if I just completely rework the player sprite? Just the code, not the costumes.

(pronouns are she/her). Advanced Alpha Game Studios Manager. Our website: https://aags2.w3spaces.com
This is JuniperActias. AKA Moth mommy. If I helped you out consider following Juni-Bug (my new account)!




If you found this secret, say uwu
Signature gradients here













cookieclickerer33
Scratcher
1000+ posts

Hitboxes

Make it switch to a costume that is in the shape of the hitbox you want when doing the touching detection, then swap back after

⠀ ⠀ I beat Mario 64 yay! ⠀⠀ ⠀ ⠀ ⠀ ⠀ I love you ivy & may :3
⠀ ⠀ ⠀ ⠀ ⠀ ⠀⠀ ⠀ ⠀GEOMETRY DASH

Dancreatesgames
Scratcher
36 posts

Hitboxes

MineTurte wrote:

Dancreatesgames wrote:

MineTurte wrote:

Dancreatesgames wrote:

MineTurte wrote:

Dancreatesgames wrote:

I'm trying to make it so that when my character hits something from below he just goes back down but the character is a apple and the stem is ruining my script I need a hitbox so he does not clip into a block
Actually I just made a hit box! You can use it if you'd like.

Link: https://scratch.mit.edu/projects/987157021/

If you need help implementing it I can help with that as well!

Hope this helps!
Yeah I need help implementing it
Could you link your project then?
Yeah sure scratch.mit.edu/projects/986382335/ I am working on it currently though so something else might be broken when you refresh
Do you mind if I just completely rework the player sprite? Just the code, not the costumes.
No I think my sprites are fine the way they are but thanks for the offer though
Dancreatesgames
Scratcher
36 posts

Hitboxes

cookieclickerer33 wrote:

Make it switch to a costume that is in the shape of the hitbox you want when doing the touching detection, then swap back after
Yeah that's exactly what I did but it breaks when I click run without screen refresh

Powered by DjangoBB