【Mini Game】2D Game Gold Miner (Level Mode)

Welcome to the Unity industry QQ exchange group: 956187480
Active project address at the end of the article


Difficulty factor: ★★★☆☆
Gameplay: Gold miner, click the screen at the right time to release the hook to pick up gold nuggets
Project introduction: Complete functions, level mode, suitable for beginners and
intermediates

Logic setting of steering gear hook


1. Hooks are divided into three states, Idle left and right in standby, Drop hooks, and Drag hooks drag state

    public void UpdateProcess()
    {
        //如果当前状态为待机idle,钩子就左右旋转待机
        if (Status == MiningMachineStatus.Idle)
        {
            Rotate();
        }
        else
        {
            //如果当前状态为扔钩子,绳子就会增长
            if (Status == MiningMachineStatus.Drop)
                DragDrop(dropSpeed);
            //如果当前状态为拉钩子,绳子就会缩短
            else if (Status == MiningMachineStatus.Drag)
                Drag();
        }

Guess you like

Origin blog.csdn.net/qq_37310110/article/details/122713706