Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how do i make hit boxes
- ametrine_
-
1000+ posts
how do i make hit boxes
here's the basic idea:
doing this will make the part of the sprite that actually collides with surroundings the “hitbox” costume, rather than the original costume
- bsteichman
-
500+ posts
how do i make hit boxes
ametrine_ is correct, however i would put the hiding, showing, and hitbox detection code in its own custom block set to “run without screen refresh” because you don't want it to flash the hitbox costume.
Last edited by bsteichman (Nov. 14, 2024 21:25:25)
- Create-Scratch101
-
500+ posts
how do i make hit boxes
this DOES work, but you can also do here's the basic idea:doing this will make the part of the sprite that actually collides with surroundings the “hitbox” costume, rather than the original costume
Edit: Please note I have not tested this yet.
Last edited by Create-Scratch101 (Nov. 14, 2024 20:14:45)
- ametrine_
-
1000+ posts
how do i make hit boxes
you only need to do this if there's any blocks that wait until the next frame before progressing the code ametrine_ is correct, however i would put the hiding, showing, and hitbox detection code in its own custom block set to “run without screen refresh” because you don't want it to flash the hitbox costume.
- ametrine_
-
1000+ posts
how do i make hit boxes
this works, but you have to make the hitbox sprite behind the sprite it's hitboxing (so its goes to the other sprite this DOES work, but you can also doafter it moves)Edit: Please note I have not tested this yet.
- Whatdidyousay245
-
86 posts
how do i make hit boxes
it will not flash the costume unless you have a repeat loop in there as each loop lasts 1 frame ametrine_ is correct, however i would put the hiding, showing, and hitbox detection code in its own custom block set to “run without screen refresh” because you don't want it to flash the hitbox costume.
it wouldn't be slow because there's a lot of code, but instead because its all happening each frame. even if you removed the stuff it would be the same speed (if this stuff didn't affect your fps)
it will not flash, even if you put a hide and show at each end of the script
- Unique-codes
-
3 posts
how do i make hit boxes
some code for an attack fill custom blocks with switch costumes and pause blocks with no spaces also
Last edited by Unique-codes (Nov. 19, 2024 20:49:05)
- NextMoveSudden
-
8 posts
how do i make hit boxes
Thankit will not flash the costume unless you have a repeat loop in there as each loop lasts 1 frame ametrine_ is correct, however i would put the hiding, showing, and hitbox detection code in its own custom block set to “run without screen refresh” because you don't want it to flash the hitbox costume.it wouldn't be slow because there's a lot of code, but instead because its all happening each frame. even if you removed the stuff it would be the same speed (if this stuff didn't affect your fps)
it will not flash, even if you put a hide and show at each end of the script
- Ym2612
-
66 posts
how do i make hit boxes
what I do is make a separate sprite, set ghost to 100 and make it go to the player controlled sprite. Then whenever the sprite is touched by anything damaging, it broadcasts a message, which the player controlled sprite picks up and starts the “damage” sequence of code
hitbox code
player controlled code
hitbox code
player controlled code
- -starlit_puma-
-
44 posts
how do i make hit boxes
I would suggest yall idk how to make hitboxes i need helpthis video (this link will take you out of Scratch)
- Discussion Forums
- » Help with Scripts
-
» how do i make hit boxes