Example #1
0
	public Inputs.DanceID executeDance ()
	{
		Inputs.DanceID t = danceID; 
		danceID = Inputs.DanceID.None;
		return t;
	}
Example #2
0
	void Update ()
	{
		time += Time.deltaTime;
        Debug.Log("update player");
		if (time < (timerbeat * 0.5f) || hasmoved) {
			return;
		}

        Debug.Log("update keys");
		Inputs.DanceID _danceID = Inputs.DanceID.None; 
		if (Input.GetKeyDown (keyCodeLeft)) { // left
			_danceID = inputs.addDirection (Inputs.Direction.Left);
			position += Vector2.left;
            moveLeftAnim();
            hasmoved = true;
		} else if (Input.GetKeyDown (keyCodeRight)) { // right
			_danceID = inputs.addDirection (Inputs.Direction.Right);
			position += Vector2.right;
            moveRightAnim();
            hasmoved = true;
        } else if (Input.GetKeyDown (keyCodeUp)) { // up
			_danceID = inputs.addDirection (Inputs.Direction.Up);
			position += Vector2.up;
            moveUpAnim();
            hasmoved = true;
		} else if (Input.GetKeyDown (keyCodeDown)) { // down
            moveDownAnim();
            _danceID = inputs.addDirection (Inputs.Direction.Down);
			position += Vector2.down;
			hasmoved = true;
		}

		if (_danceID != Inputs.DanceID.None) {
			danceID = _danceID;
		}

	}