Your Logo

About Smashing heigths:

Smashing heights is a simple climbing game where the only goal is to reach the top.

This was a solo project, in which I wanted to learn about how to make procedural animations. This was a very fun project to work on, and I now know a lot more about procedural animations.

Unity C# 4 weeks Solo project

Gameplay video:

My contribution:

Player movement

The movement was quite challenging to make, as it took me nearly the entire project to make it work. In the end it is quite simple, but it just took me a while to figure out how to do it


View whole script.

    private void OnArmSnapped(ArmTarget armTarget)
    {
        // update game manager
        gm.handSnapAmnt++;

        // reset player pos
        transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y, startPos.z);
        transform.rotation = Quaternion.identity;

        // deplete stamina
        UpdateStamina(handMoveStaminaAmount);

        ArmTarget otherArm = armTarget == armTargetLeft ? armTargetRight : armTargetLeft;
        float xMultiplier = otherArm.transform.position == armTarget.transform.position ? 1f : xOffset;

        // get positions
        Vector3 armPos = armTarget.transform.position;
        Vector3 alignPos = armAlign.position;

        // set base target pos
        Vector3 targetPos = new Vector3
        {
            x = transform.position.x + ((armPos.x - alignPos.x) / xMultiplier),
            y = transform.position.y + (armPos.y - alignPos.y),
            z = transform.position.z
        };

        // adjust target pos
        Vector3 armAlignTargetPos = armAlign.transform.position + (targetPos - transform.position);
        float distance = Vector3.Distance(otherArm.transform.position, armAlignTargetPos);
        float distanceX = otherArm.transform.position.x - armAlignTargetPos.x;
        if (distance > maxArmDistance)
        {
            targetPos.y -= targetPos.y > transform.position.y ? distance - maxArmDistance : -(distance - maxArmDistance);
        }
        if (distanceX > maxArmDistance)
        {
            targetPos.x -= targetPos.x > transform.position.x ? distanceX - maxArmDistance : -(distanceX - maxArmDistance);
        }
        if (moveCoroutine != null) StopCoroutine(moveCoroutine);
        moveCoroutine = StartCoroutine(MovePlayer(targetPos, armTarget));
    }