- Home /
Question by
JacboyX · Jun 16, 2019 at 10:00 PM ·
gridpuzzlegeneral programming
Puzzle piece rotation
I can't figure out how to swap the colors like in the game Columns. I'm just gonna try to figure out the match mechanic and the game over screen. If anyone knows how to swap the segments of the pieces, please help if you can. Here's the code:
if (Input.GetKeyDown(KeyCode.D))
{
transform.position += new Vector3(1, 0, 0);
if (CheckIsValidPosition())
{
}
else
{
transform.position += new Vector3(-1, 0, 0);
}
}
else if (Input.GetKeyDown(KeyCode.A))
{
transform.position += new Vector3(-1, 0, 0);
if (CheckIsValidPosition())
{
}
else
{
transform.position += new Vector3(1, 0, 0);
}
}
else if (Input.GetKeyDown(KeyCode.W))
{
//Insert Piece Flip Code Here
}
else if (Input.GetKeyDown(KeyCode.S) || Time.time - fall >= fallSpeed)
{
transform.position += new Vector3(0, -1, 0);
fall = Time.time;
if (CheckIsValidPosition())
{
}
else
{
transform.position += new Vector3(0, 1, 0);
}
If anyone knows, help out please.
Comment
Your answer
Follow this Question
Related Questions
Troubleshooting the spawn mechanic in a puzzle game 1 Answer
How do I force the player to press buttons in order? 2 Answers
Puzzle Piece Match Mechanic 1 Answer
Stacking Lego pieces 2 Answers