public void CheckForMatches(bool rensaChain) { Hits.Clear(); VerticalHits.Clear(); HorizontalHits.Clear(); DiagonalHitsULDR.Clear(); DiagonalHitsURDL.Clear(); BallColor = Ball.BallColor; /* HitUp will check for as many balls that spawn in a column, that way if bottom ball detects the max * number of balls, it knows the game is over. Kind of hacky, I might redo this. */ HitUp = Physics2D.RaycastAll(transform.position, Vector2.up, transform.lossyScale.y * CheckDistance, 1 << 8); Debug.DrawRay(transform.position, Vector2.up * transform.lossyScale.y * 3, Color.blue, 4); HitDown = Physics2D.RaycastAll(transform.position, -Vector2.up, transform.lossyScale.y * CheckDistance, 1 << 8); HitLeft = Physics2D.RaycastAll(transform.position, -Vector2.right, transform.lossyScale.x * CheckDistance, 1 << 8); HitRight = Physics2D.RaycastAll(transform.position, Vector2.right, transform.lossyScale.x * CheckDistance, 1 << 8); HitUpLeft = Physics2D.RaycastAll(transform.position, new Vector2(-transform.lossyScale.x, transform.lossyScale.y), (transform.lossyScale.x * transform.lossyScale.y) * CheckDistance, 1 << 8); HitUpRight = Physics2D.RaycastAll(transform.position, new Vector2(transform.lossyScale.x, transform.lossyScale.y), (transform.lossyScale.x * transform.lossyScale.y) * CheckDistance, 1 << 8); HitDownLeft = Physics2D.RaycastAll(transform.position, new Vector2(-transform.lossyScale.x, -transform.lossyScale.y), (transform.lossyScale.x * transform.lossyScale.y) * CheckDistance, 1 << 8); HitDownRight = Physics2D.RaycastAll(transform.position, new Vector2(transform.lossyScale.x, -transform.lossyScale.y), (transform.lossyScale.x * transform.lossyScale.y) * CheckDistance, 1 << 8); CheckDirection(HitUp, VerticalHits); CheckDirection(HitDown, VerticalHits); CheckDirection(HitLeft, HorizontalHits); CheckDirection(HitRight, HorizontalHits); CheckDirection(HitUpLeft, DiagonalHitsULDR); CheckDirection(HitDownRight, DiagonalHitsULDR); CheckDirection(HitUpRight, DiagonalHitsURDL); CheckDirection(HitDownLeft, DiagonalHitsURDL); //StartCoroutine(WaitForColorChange(Ball.TransitionTime, renseChain)); CheckForEnoughHits(Hits, rensaChain); }
public static Color FindColor(BallColor color, ColorScheme colorScheme) { switch (color) { case BallColor.red: return(colorScheme.Red); case BallColor.blue: return(colorScheme.Blue); case BallColor.yellow: return(colorScheme.Yellow); case BallColor.green: return(colorScheme.Green); case BallColor.orange: return(colorScheme.Orange); case BallColor.purple: return(colorScheme.Purple); case BallColor.brown: return(colorScheme.Brown); case BallColor.white: return(colorScheme.White); case BallColor.black: return(colorScheme.Black); default: return(colorScheme.White); } }
public void RemoveBallInfo(BallColor color, Node node) { int[,] rowsAndColumns; MatchTracker.TryGetValue(color, out rowsAndColumns); rowsAndColumns[(int)line_type.row, node.gridY] -= 1; rowsAndColumns[(int)line_type.col, node.gridX] -= 1; }
void Start() { //set the initial frame as the first texture. Load it from the first image on the folder // Debug.Log(sharedVideoManager.curtVideo.imageName); changePracticeScreenVideo(); if (baseName != "") { texture = (Texture)Resources.Load(baseName + "", typeof(Texture)); // Popsign set initial word for help text // POPSign add image to video caption as help text if (helpTextImageObject) { SpriteRenderer helpTextImage = helpTextImageObject.GetComponent <SpriteRenderer> (); helpTextImage.sortingLayerName = "UI layer"; helpTextImage.sortingOrder = 3; string textImageName = this.sharedVideoManager.curtVideo.imageName; helpTextImage.sprite = (Sprite)Resources.Load(textImageName, typeof(Sprite)); // Consider the image size helpTextImage.transform.localScale = new Vector3(0.5f, 0.5f, 0.0f); helpTextImage.transform.localPosition = new Vector3(0f, 0f, 0f); //set background color the same as the ball SpriteRenderer helpTextBG = helpTextObject.GetComponent <SpriteRenderer> (); BallColor color = this.sharedVideoManager.curtVideo.color; string bgName = "VideoCaption/rect_" + color; helpTextBG.sprite = (Sprite)Resources.Load(bgName, typeof(Sprite)); helpTextObject.SetActive(false); } } }
public void GetColorsInGame() { int i = 0; colorsDict.Clear(); foreach (Transform item in Balls) { if (item.tag == "centerball" || item.tag == "empty" || item.tag == "Ball") { continue; } BallColor col = (BallColor)System.Enum.Parse(typeof(BallColor), item.tag); if (!colorsDict.ContainsValue(col) && (int)col <= (int)BallColor.random) { colorsDict.Add(i, col); i++; } } // print( colorsDict.Count ); //if( !colorsDict.ContainsValue( (BallColor)System.Enum.Parse( typeof( BallColor ), boxCatapult.GetComponent<Grid>().Busy.tag ) ) ) //{ // boxCatapult.GetComponent<Grid>().Busy.GetComponent<ColorBallScript>().SetColor((BallColor) colorsDict[ Random.Range( 0, colorsDict.Count)]); //} //if( !colorsDict.ContainsValue( (BallColor)System.Enum.Parse( typeof( BallColor ), boxSecond.GetComponent<Grid>().Busy.tag ) ) ) //{ // boxSecond.GetComponent<Grid>().Busy.GetComponent<ColorBallScript>().SetColor( (BallColor)colorsDict[Random.Range( 0, colorsDict.Count )] ); //} }
public void BecomeColor(BallColor c, Material mat) { //Debug.Log(c.ToString()); BCol = c; meshRend.material = mat; }
private IEnumerator ChangeColorRoutine(BallColor destColor) { BallColor = destColor; yield return(new WaitForEndOfFrame()); yield return(StartCoroutine(CheckChainRoutine(0.25f))); }
public bool choose; // выбрана ли клетка public GameCell(CellState state, BallColor color, NewBallColor newcolor, bool choose) { this.state = state; this.color = color; this.newcolor = newcolor; this.choose = choose; }
public Color SetColor(BallColor ballColor) { switch (ballColor) { case BallColor.white: return(ColorScheme.White); case BallColor.red: return(ColorScheme.Red); case BallColor.blue: return(ColorScheme.Blue); case BallColor.yellow: return(ColorScheme.Yellow); case BallColor.green: return(ColorScheme.Green); case BallColor.orange: return(ColorScheme.Orange); case BallColor.purple: return(ColorScheme.Purple); case BallColor.brown: return(ColorScheme.Brown); case BallColor.black: return(ColorScheme.Black); } return(Color.white); }
private IEnumerator GenerateGunBallsRoutine() { List <BallColor> colors = new List <BallColor>(Balls.EndlessMode ? Balls.Colors : Balls.GetColorSet()); if (colors.Contains(BallColor.None)) { colors.Remove(BallColor.None); } charging = true; Vector3 gunPos = transform.position; gunPos.x = 0; gunPos.z = -0.5f; transform.position = gunPos; for (int i = 0; i < ShotCount; i++) { BallColor color = colors[UnityEngine.Random.Range(0, colors.Count)]; Vector2 pos = new Vector2(-(ShotCount + 1) / 2f + (i + 1), 0f); Ball newBall = Balls.CreateGunBall(pos, color); balls.Add(newBall); yield return(new WaitForEndOfFrame()); } charging = false; Charge(); }
public static ConsoleColor GetConsoleColor(BallColor ballColor) { ConsoleColor consoleBallColor; switch (ballColor) { case BallColor.Yellow: consoleBallColor = ConsoleColor.Yellow; break; case BallColor.Red: consoleBallColor = ConsoleColor.Red; break; case BallColor.Magenta: consoleBallColor = ConsoleColor.Magenta; break; case BallColor.Green: consoleBallColor = ConsoleColor.Green; break; case BallColor.Cyan: consoleBallColor = ConsoleColor.Cyan; break; case BallColor.Blue: consoleBallColor = ConsoleColor.Blue; break; case BallColor.Black: default: consoleBallColor = ConsoleColor.Black; break; } return consoleBallColor; }
public Ball GetBall(BallColor color, int id) { if (color == BallColor.White) { foreach (Ball ball in whiteBalls) { if (ball.ballId == id) { return(ball); } } } else { foreach (Ball ball in blackBalls) { if (ball.ballId == id) { return(ball); } } } return(null); }
public bool LegalMoveCheck(BallColor ball, PlayerColor player) { if (ball == BallColor.brown || ball == BallColor.black) { return(false); } else { bool verdict = false; switch (player) { case PlayerColor.red: verdict = (ball != BallColor.red) ? true : false; break; case PlayerColor.blue: verdict = (ball != BallColor.blue) ? true : false; break; case PlayerColor.yellow: verdict = (ball != BallColor.yellow) ? true : false; break; } return(verdict); } }
public void SetPlayersData(BallColor _aiColor, int _aiScore, BallColor _playerColor, int _playerScore) { aiColor = _aiColor; aiScore = _aiScore; opponentColor = _playerColor; opponentScore = _playerScore; }
public static int GetCellToWinCount(ModelGrid grid, List <Cell> cells, BallColor color = BallColor.Black) { int count = 0; if (cells.Count < 5) { return(-1); } Cell cell; for (int i = 0; i < cells.Count; i++) { cell = cells [i]; if (cell.HasBall(color)) { count++; } else if (cell.HasBall()) { return(-1); } // if (cell.HasBall(BallColor.White)) { // return -1; // } // // if(cell.HasBall(BallColor.Black)) { // count++; // } } return(count); }
public static Color Get_Ball_Color(BallColor ball) { Color aux = Color.white; switch (ball) { case BallColor.YELLOW: aux = Color.yellow; aux += new Color(0.3f, 0.3f, 0.3f); break; case BallColor.RED: aux = Color.red; aux += new Color(0f, 0.3f, 0.3f); break; case BallColor.BLUE: aux = Color.blue; aux += new Color(0.3f, 0.3f, 0f); break; case BallColor.GREEN: aux = Color.green; aux += new Color(0.3f, 0f, 0.3f); break; } return(aux); }
// Use this for initialization void Start() { ballcolor = new BallColor(Material1, Material2, renderer); scoreboard = new Scoreboard(); gameControl = new GameControl(); startPos = transform.position; }
private static bool CheckWinVerticalIA(ModelGrid grid, Cell cell) { Cell neighbour; BallColor color = BallColor.Black; int count = 1; List <Cell> patternCells = new List <Cell> (); patternCells.Add(cell); // down for (int i = 1; i < nBallToAlignVertically; i++) { neighbour = grid.GetCellFromModel(cell.x, cell.y - i * 2); if (!neighbour) { break; } if (neighbour.HasBall(color)) { count++; patternCells.Add(neighbour); } else { break; } } //up for (int i = 1; i < nBallToAlignVertically; i++) { neighbour = grid.GetCellFromModel(cell.x, cell.y + i * 2); if (!neighbour) { break; } if (neighbour.HasBall(color)) { count++; patternCells.Add(neighbour); } else { break; } } /*if(count >= nBallToAlignVertically) * HighlighCells (patternCells, Color.red);*/ return(count >= nBallToAlignVertically); }
public void SetGunBallType(BallColor ballColor) { if (bonusColorDic.ContainsKey(ballColor)) { SetGunBallType(bonusColorDic[ballColor]); } }
public void Cmd_Activate_Ball(BallColor color) { if (hasBall) { //this was already active. what are you trying to do? //Debug.Log("A1"); //Debug.Break(); Tile down = this; do { down = grid.Get_Tile_Down(down); } while (down.hasBall); if (down == null) { down = grid.Get_Tile_Up(down); } down.Cmd_Activate_Ball(color); return; } ballSprite.transform.localScale = Vector3.one; ballColor = color; hasBall = true; ballSprite.enabled = true; ballSprite.color = Get_Ball_Color(ballColor); }
private void AddToBallCount(BallColor color, int numberOfBalls) { switch (color) { case BallColor.red: PlayerManager.PlayerStats.RedCleared += numberOfBalls; break; case BallColor.blue: PlayerManager.PlayerStats.BlueCleared += numberOfBalls; break; case BallColor.yellow: PlayerManager.PlayerStats.YellowCleared += numberOfBalls; break; case BallColor.orange: PlayerManager.PlayerStats.OrangeCleared += numberOfBalls; break; case BallColor.purple: PlayerManager.PlayerStats.PurpleCleared += numberOfBalls; break; case BallColor.green: PlayerManager.PlayerStats.GreenCleared += numberOfBalls; break; case BallColor.brown: PlayerManager.PlayerStats.BrownCleared += numberOfBalls; break; } }
public void Init(bool gunBall, BallType ballType, BallStyle style, BallColor ballColor, bool checkJoin = false) { if (!ballCollider) { ballCollider = GetComponent <CircleCollider2D>(); } if (!BallBody2D) { BallBody2D = GetComponent <Rigidbody2D>(); } this.style = style; reactAfterJoint = false; killAfterJoint = false; this.ballColor = BallColor.None; ballRenderer.color = Color.white; Colored = true; Destroying = false; waveNum = 0; Targeted = false; ClearJoints(); BallBody2D.isKinematic = this.gunBall = gunBall; BallType = ballType; BallColor = ballColor; WasJoin = false; ballCollider.enabled = true; if (checkJoin) { JoinNearBalls(ballCollider.radius); } }
public void SetPawnsStartPosition(BallColor ballColor, BallColor startPositionColor) { if (ballColor == BallColor.Black) { foreach (Ball blackB in blackBalls) { if (startPositionColor == BallColor.Black) { blackB.startPosition = blackStartPosition[blackB.ballId].transform.localPosition; } else { blackB.startPosition = whiteStartPosition[blackB.ballId].transform.localPosition; } } } else { foreach (Ball whiteB in whiteBalls) { if (startPositionColor == BallColor.Black) { whiteB.startPosition = blackStartPosition[whiteB.ballId].transform.localPosition; } else { whiteB.startPosition = whiteStartPosition[whiteB.ballId].transform.localPosition; } } } }
void GUIBlocks() { GUILayout.BeginHorizontal(); GUILayout.Space(30); GUILayout.BeginVertical(); GUILayout.BeginVertical(); GUILayout.Label("Tools:", EditorStyles.boldLabel); if (GUILayout.Button("Clear", new GUILayoutOption[] { GUILayout.Width(50), GUILayout.Height(50) })) { for (int i = 0; i < levelSquares.Length; i++) { levelSquares[i] = 0; } SaveLevel(); } GUILayout.EndVertical(); GUILayout.Label("Balls:", EditorStyles.boldLabel); GUILayout.BeginHorizontal(); GUILayout.Space(30); GUILayout.BeginVertical(); GUILayout.BeginHorizontal(); for (int i = 1; i <= System.Enum.GetValues(typeof(BallColor)).Length; i++) { if ((BallColor)i != 0) { if (GUILayout.Button(ballTex[i - 1], new GUILayoutOption[] { GUILayout.Width(50), GUILayout.Height(50) })) { if ((BallColor)i != BallColor.chicken) { brush = (BallColor)i; } else { target = Target.Chicken; levelSquares[5 * maxCols + 5] = BallColor.chicken; SaveLevel(); } } } } if (GUILayout.Button(" ", new GUILayoutOption[] { GUILayout.Width(50), GUILayout.Height(50) })) { brush = 0; } // GUILayout.Label(" - empty", EditorStyles.boldLabel); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); }
private Color32 getBallColor(BallColor c) { if (c != BallColor.None && BallColors.ContainsKey(c)) { return(BallColors[c]); } return(Color.white); }
private Ball CreateBall(Vector2 pos, BallType ballType, BallColor ballColor) { GameObject ballObject = BallsPool.FastInstantiate(pos, Quaternion.identity, transform); Ball ball = ballObject.GetComponent <Ball>(); ball.Init(false, ballType, GameData.BallStyle, ballColor, true); return(ball); }
public Ball(PuzzleBooble3dGame game, Vector3 position, BallColor color) : base(game) { Color = color; Position = position; AnimationHelper = new BallAnimationHelper(this); }
private Sprite getColorFigureSprite(BallColor color) { if (ColorFigureSprites.ContainsKey(color)) { return(ColorFigureSprites[color]); } return(null); }
public Ball(Game game, BallColor color) { this.game = game; this.color = color; //image = Image.FromFile(@"assets/red.png"); da.Completed += d_Completed; }
public Video(int _frameNumber, string _fileName, string _folderName, string _imageName, BallColor _color) { frameNumber = _frameNumber; fileName = _fileName; folderName = _folderName; imageName = _imageName; color = _color; }
/// <summary> /// Constructs a new representation as a visual ball with a number of string in its center. /// </summary> /// <param name="currentActivity">The activity on which the ball should be drawn.</param> /// <param name="note">The note that should be played correspondingly when visually arriving to the guitar's neck.</param> public NoteRepresentation(Activity currentActivity, Note note) { //Basic values. _currentActivity = currentActivity; _note = note; //The color of the ball. BallColor ballColor = (BallColor)note.Position.String; //note.Position.Fret; //Which string the number on the ball should represent. //GuitarString stringNum = note.Position.String; _noteCircle = new TextView(_currentActivity); //Select the ball's color. switch (ballColor) { case BallColor.Red: _noteCircle.SetBackgroundResource(Resource.Drawable.ball_red); break; case BallColor.Purple: _noteCircle.SetBackgroundResource(Resource.Drawable.ball_purple); break; case BallColor.Blue: _noteCircle.SetBackgroundResource(Resource.Drawable.ball_blue); break; case BallColor.Green: _noteCircle.SetBackgroundResource(Resource.Drawable.ball_green); break; case BallColor.Orange: _noteCircle.SetBackgroundResource(Resource.Drawable.ball_orange); break; case BallColor.Aqua: _noteCircle.SetBackgroundResource(Resource.Drawable.ball_aqua); break; case BallColor.Yellow: _noteCircle.SetBackgroundResource(Resource.Drawable.ball_yellow); break; } //Set dimensions. _noteCircle.Layout(0, 0, BUTTON_WIDTH, BUTTON_HEIGHT); //Center text. _noteCircle.Gravity = GravityFlags.Center; //Set text. //_noteCircle.SetText(((int)stringNum).ToString(), TextView.BufferType.Normal); //Refresh view. _noteCircle.RequestLayout(); //Add the newly created note circle to the current activity. _currentActivity.AddContentView(_noteCircle, new ViewGroup.LayoutParams(BUTTON_WIDTH, BUTTON_HEIGHT)); }
private static bool CheckWinHorizontalIA(ModelGrid grid, Cell cell) { Cell neighbour; BallColor color = BallColor.Black; List <Cell> patternCells = new List <Cell> (); patternCells.Add(cell); int count = 1; // left for (int i = 1; i < nBallToAlignHorizontally; i++) { neighbour = grid.GetCellFromModel(cell.x - i, cell.y); if (!neighbour) { break; } if (neighbour.HasBall(color)) { patternCells.Add(neighbour); count++; } else { break; } } //right for (int i = 1; i < nBallToAlignHorizontally; i++) { neighbour = grid.GetCellFromModel(cell.x + i, cell.y); if (!neighbour) { break; } if (neighbour.HasBall(color)) { patternCells.Add(neighbour); count++; } else { break; } } /*if(count >= nBallToAlignHorizontally) * HighlighCells (patternCells, Color.red);*/ return(count >= nBallToAlignHorizontally); }
public bool HasBall(BallColor color) { if (!HasBall()) { return(false); } return(ball.Color == color); }
public GameObject Instantiate_Ball_For_Anim(BallColor color) { GameObject aux = Instantiate(ballPrefab, this.transform.parent.parent, false); aux.GetComponentInChildren <Image>().color = Get_Ball_Color(color); aux.transform.position = this.transform.position; return(aux); }
private void SetSettings(BallColor color) { if (color == BallColor.chicken) { if (LevelData.mode == ModeGame.Rounded) { } } }
void colorFade(Ball ball, bool chosen) { if (chosen) { originalColor = ball.color; Renderer rend = ball.GetComponent<Renderer>(); Material highlighted = Resources.Load("Black") as Material; rend.material = highlighted; } else ball.color = originalColor; }
public BallPoint(Sector sec, Point p, BallColor ballcolor, bool isColored) { Sector = sec; IsColored = isColored; Coord = p; PointColor = ballcolor; Id = Guid.NewGuid(); Size = new Size(Radius, Radius); BackColor = Color.FromArgb(247, 235, 200); DrawBallPoint(); BackgroundImageLayout = ImageLayout.Zoom; BallPoint b = this; Items.Add(Id, b); }
public void AddBallInfo(BallColor color, Node node) { int[,] rowsAndColumns; MatchTracker.TryGetValue(color, out rowsAndColumns); int x = node.gridX; int y = node.gridY; rowsAndColumns[(int)line_type.row, y] += 1; rowsAndColumns[(int)line_type.col, x] += 1; int number_of_removed = 0; //check if there is a row and column simultaneously if (rowsAndColumns[(int)line_type.col, x] >= 5 && rowsAndColumns[(int)line_type.row, y] >= 5 && Grid.Instance.grid[x, y].assignedBall != null && Grid.Instance.grid[x, y].assignedBall.color.Equals(color)) { number_of_removed = FindMatchedBalls(line_type.col, x, color); if (number_of_removed != 0) { //adding a temporary ball so row can also be matched rowsAndColumns[(int)line_type.row, y] += 1; } AddScore(number_of_removed); int number_of_removed2 = FindMatchedBalls(line_type.row, y, color); if (number_of_removed2 == 0) { //removing temporary ball rowsAndColumns[(int)line_type.row, y] -= 1; } AddScore(number_of_removed + number_of_removed2); } else { if (rowsAndColumns[(int)line_type.col, x] >= 5) { number_of_removed = FindMatchedBalls(line_type.col, x, color); } else if (rowsAndColumns[(int)line_type.row, y] >= 5) { number_of_removed = FindMatchedBalls(line_type.row, y, color); } AddScore(number_of_removed); } }
public void Init(BallColor color) { float fact = Random.Range(0.3f,1f); this.gameObject.tag = "PickUp"; transform.localScale = Vector3.zero; Color tmp = new Color(0,0,0); switch(color) { case BallColor.RED: tmp = new Color(fact,0,0); break; case BallColor.GREEN: tmp = new Color(0, fact, 0); break; case BallColor.BLUE: tmp = new Color(0, 0, fact); break; } GetComponent<Renderer>().material.color = tmp; }
public Ball(Game game, BallColor color, Point location) : this(game, color) { this.location = location; }
int FindMatchedBalls(line_type rowOrColumnIdentifier, int line_index, BallColor color) { List<Node> columnNodesToRemove = new List<Node>(); for (int i = 0; i < 7; i++) { Node current = get_element(rowOrColumnIdentifier, line_index, i); if (current.assignedBall != null && current.assignedBall.color.Equals(color)) { columnNodesToRemove.Add(current); } else { if (columnNodesToRemove.Count < 5) { columnNodesToRemove.Clear(); } else { break; } } } int number_of_removed = 0; if (columnNodesToRemove.Count >= 5) { number_of_removed = columnNodesToRemove.Count; foreach (Node node in columnNodesToRemove) { if (node.assignedBall) { node.assignedBall.DestroyBall(); RemoveBallInfo(color, node); Grid.Instance.UpdateNodeStatus(node, true); } } } return number_of_removed; }
public Material getMaterial(BallColor color) { return this.materials[(int)color]; }
private void OpenAllZonesOtherThan(BallColor color) { var availableColors = Enum.GetValues(typeof(BallColor)).Cast<BallColor>(); var hazardousZones = availableColors.Where(c => c != color) .Select(c => ZoneFor(c)); foreach (GameObject zone in hazardousZones) { zone.GetComponent<ZoneController>().changeState(); } if (!PlayerIsInSafeZone (color)) { playerController.Fall (); } else if (!remainingSequence.Any()) { UpdateScore(); } }
private bool PlayerIsInSafeZone(BallColor color) { Ray ray = new Ray(mainCamera.transform.position, Vector3.down); RaycastHit hit; bool isInSafeZone = false; if (Physics.Raycast(ray, out hit, 10)) { GameObject zone = ZoneFor(color); if (zone != null) { isInSafeZone = hit.transform.IsChildOf(zone.transform); } } return isInSafeZone; }
private Color ColorFor(BallColor color) { switch (color) { case BallColor.Blue: return Color.blue; case BallColor.Red: return Color.red; case BallColor.Yellow: return Color.yellow; case BallColor.Green: return Color.green; default: return Color.white; } }
private void LightPipeWithColor(Pipe pipe, BallColor ballColor) { Animator anim = PipeFor(pipe).GetComponent<Animator>(); anim.SetInteger("couleur", (int)ballColor); AudioSource leSon = PipeFor(pipe).GetComponent<AudioSource>(); leSon.Play(); }
private bool IsAcceptable(BallColor color) { return (sequence.Count < 2 || !(sequence.Reverse().Take(2).All(c => c == color))); }
private GameObject ZoneFor(BallColor color) { switch (color) { case BallColor.Blue: return blueZone; case BallColor.Red: return redZone; case BallColor.Yellow: return yellowZone; case BallColor.Green: return greenZone; default: return null; } }
public void Initialize(Texture2D texture, int xPosition, int yPosition, BallColor ballColor) { Texture = texture; XPosition = xPosition; YPosition = yPosition; Position = new Vector2(xPosition * Width, (yPosition * Height) + 100); IsAlive = true; color = ballColor; }