//Set the current group active public void SetActive() { isActive = true; physics.gravityScale = Playfield.CalculateLevelSpeed(); CheckForGameOver(); }
// Update is called once per frame void Update() { if (isActive) { if (Input.GetKeyDown(KeyCode.Space) && (double)Time.time > (double)Playfield.lastSwap) { SwitchHold(); } //Move Left else if (Input.GetKeyDown(KeyCode.LeftArrow)) { MoveLeft(); } //Move Right else if (Input.GetKeyDown(KeyCode.RightArrow)) { MoveRight(); } //Rotate else if (Input.GetKeyDown(KeyCode.UpArrow)) { MoveRotate(); } //Fall else if (Input.GetKeyDown(KeyCode.DownArrow) || (double)Time.time - (double)lastFall >= Playfield.CalculateLevelSpeed()) { MoveDown(); } } }