コード例 #1
0
    // Update is called once per frame
    void FixedUpdate()
    {
        float horizontalDir = Input.GetAxis("Horizontal");
        float verticalDir   = Input.GetAxis("Vertical");

        //player.Translate(new Vector3(horizontalDir * Time.deltaTime * steerSpeed, verticalDir * Time.deltaTime * forwardSpeed, player.position.z));

        rb.velocity = new Vector2(horizontalDir * Time.deltaTime * steerSpeed, verticalDir * Time.deltaTime * forwardSpeed);
        if (Input.GetButton("Fire1"))
        {
            FireLaser();
        }

        fireTimer -= Time.deltaTime;

        if (Input.GetKeyDown(KeyCode.Q))
        {
            hpbar.IncreaseHP();
        }
    }