Fangames > Programming Questions
Problem with hitbox of animated sprites
(1/1)
IceFreaki:
Hey everyone!
So I've recently started to mess around with Game Maker again after a short break of just 4 years and I've been having quite some fun so far.
But I kinda found a lil' problem with one of the objects I'm using. It's an animated sprite and wiggles around a bunch and well, I'll explain with a few pictures to make it clear.
The animated sprite uses 30 frames and one of those frames looks like this:
(click to show/hide)
See that leg that's sticking out? That should obviously kill you if you dare touch it. Now to another frame that comes a bit later.
It looks like this:
(click to show/hide)
The Guy should be able to fall through but the game still uses the earlier frames as the hitbox (or rather, the hitbox of all frames together). The transparent leg is where it was on the earlier frame and shouldn't harm the Guy since it's not there.
But sadly, that isn't the case and well, Guy dies to the invisible leg.
(click to show/hide)
Does anyone know how I can make it so that it only uses the hitbox of the frame that is currently displayed and not as if all frames are one frame or something like that...
Thanks~
Sudnep:
images explains it better
(click to show/hide)image with different stuff in different places
click modify mask (hitbox area) ... you can the next step by clicking Separate collision masks
the area in the right shows it's current hitbox for selected image index
click separate collision masks
IceFreaki:
Oh wow, that's easy
Thank you so much!
Navigation
[0] Message Index
Go to full version