
--- jump to current player position in 1s
--- x2-5
function onBegin()
    --log("BOUNCE")
    setFlag("hk_change_to_no_head", true)

    local iterations = (seededRandom()%4) + 2

    for i = 1, iterations do 
        playPuppetAnim("infectedSlam")
        local target = player.Position
		playSound("event:/CC/CC_HollowKnight/SFX/Boss SFX/NoskJump",puppet.Center)
        speedXTweenTo((target.X - puppet.Position.X)*2.5, 0.5)
        wait(speedYTweenTo(-400, 0.25))
        

        attack = getNewBasicAttackEntity(puppet.Position + vector2(-20, -4), getHitbox(35, 40))
        addEntity(attack)
        addComponentToBoss(getEntityChain(attack))

        speedYTweenTo(0, 0.25)
        wait(speedXTweenTo(0, 0.5))
    
        playPuppetAnim("infectedSlamM")
        while not puppet.Grounded do
            wait()
        end
        wait(0.25)
        attack:RemoveSelf()
    end
    

    playPuppetAnim("idle")
    setFlag("hk_change_to_main", true)
    
end