Exemple #1
0
 // Update is called once per frame
 void Update()
 {
     ProInput.UpdateInput(Time.deltaTime);
     if (ProInput.A)
     {
         SceneManager.LoadScene("intro");
     }
 }
Exemple #2
0
    void Start()
    {
        ProInput.Init();

        GrabObjectsToWorld.Parse(ref world);

        WorldInit.Parse(ref world, ref data, ref delta, ref controls);
    }
Exemple #3
0
    void Update()
    {
        float deltaBase = Time.deltaTime;

        deltaRun   = deltaBase * deltaModifier;
        deltaTimer = deltaBase;
        ProInput.UpdateInput(deltaRun, debug: true);

        Vector3 charPosition = character.transform.localPosition;
        Vector3 camPosition  = mainCamContainer.transform.localPosition;

        charX = charPosition.x;
        charY = charPosition.y;
        charZ = charPosition.z;

        camX = camPosition.x;
        camY = camPosition.y;
        camZ = camPosition.z;

        preCharX = charX;
        preCharZ = charZ;

        hitActionButton = ProInput.A;

        HandleControls();

        Flames();
        DealWithCollisions();
        ManageCamera();
        ManageAnimations();

        Vector3 newPos = new Vector3(charX, charY, charZ);

        character.transform.localPosition = newPos;
        Vector3 newcamPos = new Vector3(camX, camY, camZ);

        mainCamContainer.transform.localPosition = newcamPos;
    }
Exemple #4
0
    void Start()
    {
        ProInput.Init();

        //Obj load
        obstacles = AllOfClass.PickAllOf <Obstacle>();
        flames    = AllOfClass.PickAllOf <Parent>();

        //setups
        SetupFlames();
        firstFlame.Activate();
        gameStart = false;

        particlesHappy.SetActive(false);
        //Camera setup
        ogCamCharComparison = character.transform.localPosition - mainCamContainer.transform.localPosition;
        homeReminder.SetActive(false);
        winReminder.SetActive(false);
        //init
        charState = CharacterState.IDLE; // CHANGE FOR OP
        ManageAnimations();
        StartCoroutine("GameInit");
    }
Exemple #5
0
 // Start is called before the first frame update
 void Start()
 {
     ProInput.Init();
 }
Exemple #6
0
    public static void Parse(Deltas delta, World world, ref InputsManager controls)
    {
        // Proprietary input system
        ProInput.UpdateInput(delta.mainDelta, true);

        AnalogueInput joystick = ProInput.GlobalActionStick;

        if (joystick.IsActive())
        {
            float stickAngle = joystick.Angle;
            float stickCos   = Mathf.Cos(stickAngle);
            float stickSin   = Mathf.Sin(stickAngle);

            float realJoystickPress = (joystick.Distance - joystick.DeadZone) / (1 - joystick.DeadZone);

            if (stickCos > joystick.DeadZone)
            {
                controls.movement.x = 1;
            }

            if (stickCos < -joystick.DeadZone)
            {
                controls.movement.x = -1;
            }

            //controls.movement.x = stickCos;
            controls.movement.y = stickSin;
        }
        else
        {
            controls.movement.x = 0;
            controls.movement.y = 0;
        }


        // mouse pointer x and y
        Vector3 inputMouseRaw = Input.mousePosition;

        // Needed hack
        inputMouseRaw.z = 10;
        Vector3 mouse = world.cam.camera.ScreenToViewportPoint(inputMouseRaw);

        controls.pointer.x = mouse.x;
        controls.pointer.y = mouse.y;


        // You have to stop holding the action button to press it
        // For constant fire
        if (!controls.holdingActionButton)
        {
            controls.actionButton = ProInput.A;
        }
        if (ProInput.A)
        {
            controls.holdingActionButton = true;
        }
        else
        {
            controls.holdingActionButton = false;
        }


        // You have to stop holding the action button to press it
        // For constant fire
        if (!controls.holdingQuackButton)
        {
            controls.quak = ProInput.B;
        }
        if (ProInput.B)
        {
            controls.holdingQuackButton = true;
        }
        else
        {
            controls.holdingQuackButton = false;
        }
    }