i expect you will have to check for the current frame and change the hitbox accordingly, somehow. IE:
// Project: ChangeBox
// Created: 2021-04-27
// By: Virtual Nomad
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "ChangeBox" )
SetWindowSize( 1280,720, 0 )
SetWindowAllowResize( 1 )
// set display properties
SetVirtualResolution( 1280,720)
SetOrientationAllowed( 1, 1, 1, 1 )
SetSyncRate( 30, 0 )
SetScissor( 0,0,0,0 )
UseNewDefaultFonts( 1 )
//make a 3 box image
for x = 1 to 3
CreateSprite(x,0)
SetSpriteSize(x,x*32,x*32)
SetSpriteColor(x,255,0,0,128)
SetSpritePositionByOffset(x, x*96-48, 48)
next x
Render()
Sheet = GetImage(0,0,288,96)
for x = 1 to 3
DeleteSprite(x)
next x
ThisSprite = CreateSprite(Sheet)
SetSpritePositionByOffset(ThisSprite, 640, 360)
SetSpriteAnimation(ThisSprite,96,96,3)
PlaySprite(ThisSprite,1)
ThisFrame = GetSpriteCurrentFrame(ThisSprite)
SetSpriteShapeBox(ThisSprite, ThisFrame*-16, ThisFrame*-16, ThisFrame*16, ThisFrame*16, 0)
SetPhysicsDebugOn()
do
If ThisFrame <> GetSpriteCurrentFrame(ThisSprite)
ThisFrame = GetSpriteCurrentFrame(ThisSprite)
SetSpriteShapeBox(ThisSprite, ThisFrame*-16, ThisFrame*-16, ThisFrame*16, ThisFrame*16, 0)
Endif
If GetRawKeyState(27) then Exit
Print(ThisFrame)
Sync()
loop