public void Move() { if (Spike.Id == 1 || Spike.Id == 3) { if (Spike.X < THIRTY_FOUR * Global.Var.SCALE) { Spike.SetState(Spike.idleState); Spike.CurrentState.Start = true; } else if (count > FORTY) { Spike.X = Spike.X - F_DOT_EIGHT * Global.Var.SCALE; } } else if (Spike.Id == 2 || Spike.Id == 4) { if (Spike.X > TWO_HUNDRED_SEVEN * Global.Var.SCALE) { Spike.SetState(Spike.idleState); Spike.CurrentState.Start = true; } else if (count > FORTY) { Spike.X = Spike.X + F_DOT_EIGHT * Global.Var.SCALE; } } }
public void Move() { if (Start == true) { Start = false; } if (Spike.Id == 1 || Spike.Id == 2) { if (Spike.Y > ONE_HUNDRED_THIRTY_FIVE * Global.Var.SCALE) { Spike.SetState(Spike.verticalMovingBackward); Spike.CurrentState.Start = true; } else { Spike.Y = Spike.Y + F_ONE_DOT_FIVE * Global.Var.SCALE; } } else if (Spike.Id == 3 || Spike.Id == 4) { if (Spike.Y < ONE_HUNDRED_FIFTY_TWO * Global.Var.SCALE) { Spike.SetState(Spike.verticalMovingBackward); Spike.CurrentState.Start = true; } else { Spike.Y = Spike.Y - F_ONE_DOT_FIVE * Global.Var.SCALE; } } }
public void Move() { if (Spike.Id == 1 || Spike.Id == 2) { if (Spike.Y < NINETY_SEVEN * Global.Var.SCALE) { Spike.SetState(Spike.idleState); Spike.CurrentState.Start = true; } else { Spike.Y = Spike.Y - F_DOT_SEVEN * Global.Var.SCALE; } } else if (Spike.Id == 3 || Spike.Id == 4) { if (Spike.Y > ONE_HUNDRED_EIGHTY_NINE * Global.Var.SCALE) { Spike.SetState(Spike.idleState); Spike.CurrentState.Start = true; } else { Spike.Y = Spike.Y + F_DOT_SEVEN * Global.Var.SCALE; } } }
public void Move() { if (Start == true) { Start = false; } if (Spike.Id == 1 || Spike.Id == 3) { if (Spike.X > ONE_HUNDRED_ELEVEN * Global.Var.SCALE) { Spike.SetState(Spike.horizontalMovingBackward); Spike.CurrentState.Start = true; } else { Spike.X = Spike.X + F_ONE_DOT_FIVE * Global.Var.SCALE; } } else if (Spike.Id == 2 || Spike.Id == 4) { if (Spike.X < ONE_HUNDRED_TWENTY_NINE * Global.Var.SCALE) { Spike.SetState(Spike.horizontalMovingBackward); Spike.CurrentState.Start = true; } else { Spike.X = Spike.X - F_ONE_DOT_FIVE * Global.Var.SCALE; } } }
private void CheckAndUpdateTopLeftSpike() { Spike currentSpike = attachedHackCard.GetTopLeftSpike(); Spike leftSpike = leftSquare.GetTopRightSpike(); Spike aboveLeftSpike = aboveLeftDiagonalSquare.GetBottomRightSpike(); Spike aboveSpike = aboveSquare.GetBottomLeftSpike(); string color = currentSpike.GetSpikeColor(); if (leftSpike && aboveSpike && aboveLeftSpike && color == leftSpike.GetSpikeColor() && color == aboveSpike.GetSpikeColor() && color == aboveLeftSpike.GetSpikeColor()) { // ALL FOUR CONNECTED currentSpike.SetState("two"); aboveSpike.SetState("two"); leftSpike.SetState("two"); aboveLeftSpike.SetState("two"); UpdatePoints(color, 4); } else if (leftSpike && aboveLeftSpike && color == leftSpike.GetSpikeColor() && color == aboveLeftSpike.GetSpikeColor()) { // LEFT, DIAGONAL currentSpike.SetState("left"); leftSpike.SetState("two"); aboveLeftSpike.SetState("down"); UpdatePoints(color, 3); } else if (aboveSpike && aboveLeftSpike && color == aboveSpike.GetSpikeColor() && color == aboveLeftSpike.GetSpikeColor()) { // UP DIAGONAL currentSpike.SetState("up"); aboveSpike.SetState("two"); aboveLeftSpike.SetState("right"); UpdatePoints(color, 3); } else if (leftSpike && aboveSpike && color == leftSpike.GetSpikeColor() && color == aboveSpike.GetSpikeColor()) { // LEFT UP currentSpike.SetState("two"); leftSpike.SetState("right"); aboveSpike.SetState("down"); UpdatePoints(color, 3); } else if (leftSpike && color == leftSpike.GetSpikeColor()) { // LEFT currentSpike.SetState("left"); leftSpike.SetState("right"); UpdatePoints(color, 2); } else if (aboveSpike && color == aboveSpike.GetSpikeColor()) { // UP currentSpike.SetState("up"); aboveSpike.SetState("down"); UpdatePoints(color, 2); } else { // NONE currentSpike.SetState("closed"); } currentSpike.SetSpikeImage("topleft"); if (aboveSpike) { aboveSpike.SetSpikeImage("bottomleft"); } if (aboveLeftSpike) { aboveLeftSpike.SetSpikeImage("bottomright"); } if (leftSpike) { leftSpike.SetSpikeImage("topright"); } }
private void CheckAndUpdateBottomRightSpike() { Spike currentSpike = attachedHackCard.GetbottomRightSpike(); Spike rightSpike = rightSquare.GetBottomLeftSpike(); Spike belowRightSpike = belowRightDiagonalSquare.GetTopLeftSpike(); Spike belowSpike = belowSquare.GetTopRightSpike(); string color = currentSpike.GetSpikeColor(); if (rightSpike && belowSpike && belowRightSpike && color == rightSpike.GetSpikeColor() && color == belowSpike.GetSpikeColor() && color == belowRightSpike.GetSpikeColor()) { // ALL FOUR CONNECTED currentSpike.SetState("two"); belowSpike.SetState("two"); rightSpike.SetState("two"); belowRightSpike.SetState("two"); UpdatePoints(color, 4); } else if (rightSpike && belowRightSpike && color == rightSpike.GetSpikeColor() && color == belowRightSpike.GetSpikeColor()) { // RIGHT, DIAGONAL currentSpike.SetState("right"); rightSpike.SetState("two"); belowRightSpike.SetState("up"); UpdatePoints(color, 3); } else if (belowSpike && belowRightSpike && color == belowSpike.GetSpikeColor() && color == belowRightSpike.GetSpikeColor()) { // DOWN DIAGONAL currentSpike.SetState("down"); belowSpike.SetState("two"); belowRightSpike.SetState("left"); UpdatePoints(color, 3); } else if (rightSpike && belowSpike && color == rightSpike.GetSpikeColor() && color == belowSpike.GetSpikeColor()) { // RIGHT DOWN currentSpike.SetState("two"); rightSpike.SetState("left"); belowSpike.SetState("up"); UpdatePoints(color, 3); } else if (rightSpike && color == rightSpike.GetSpikeColor()) { // RIGHT currentSpike.SetState("right"); rightSpike.SetState("left"); UpdatePoints(color, 2); } else if (belowSpike && color == belowSpike.GetSpikeColor()) { // DOWN currentSpike.SetState("down"); belowSpike.SetState("up"); UpdatePoints(color, 2); } else { // NONE currentSpike.SetState("closed"); } currentSpike.SetSpikeImage("bottomright"); if (belowSpike) { belowSpike.SetSpikeImage("topright"); } if (belowRightSpike) { belowRightSpike.SetSpikeImage("topleft"); } if (rightSpike) { rightSpike.SetSpikeImage("bottomleft"); } }