Discuss Scratch

Dancreatesgames
Scratcher
43 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)


15+ (not revealing age) girl. Pronouns are she/her.
Host of The Pi Counsel. Comment in studio to join.

Front-end web developer & software programmer. I use JS, HTML, & CSS. Learning python3 right now.
Grammar fanatic as well

If I helped you out consider following Juni-Bug!


Select this + shift + down arrow = view rest of signature

This is JuniperActias. AKA Moth mommy.





Signature gradients here





If you found this secret; reply with ‘uwu’ with absolutely no context













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
43 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?

15+ (not revealing age) girl. Pronouns are she/her.
Host of The Pi Counsel. Comment in studio to join.

Front-end web developer & software programmer. I use JS, HTML, & CSS. Learning python3 right now.
Grammar fanatic as well

If I helped you out consider following Juni-Bug!


Select this + shift + down arrow = view rest of signature

This is JuniperActias. AKA Moth mommy.





Signature gradients here





If you found this secret; reply with ‘uwu’ with absolutely no context













Dancreatesgames
Scratcher
43 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
43 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.

15+ (not revealing age) girl. Pronouns are she/her.
Host of The Pi Counsel. Comment in studio to join.

Front-end web developer & software programmer. I use JS, HTML, & CSS. Learning python3 right now.
Grammar fanatic as well

If I helped you out consider following Juni-Bug!


Select this + shift + down arrow = view rest of signature

This is JuniperActias. AKA Moth mommy.





Signature gradients here





If you found this secret; reply with ‘uwu’ with absolutely no context













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
43 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
43 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