public void drawTileCapture(TileState state) // int x, int y, float capPct) { float numTiles = partialCapTiles.Length; float pctSlices = 1f / numTiles; float capPct = state.getCapPercent(); int x = state.getTilePosition().x; int y = state.getTilePosition().y; if (capPct >= 1f) { capturedGrid.SetTile(new Vector3Int(x, y, 0), fullCapTile); } else { int tileNum = Mathf.FloorToInt(capPct / pctSlices); capturedGrid.SetTile(new Vector3Int(x, y, 0), partialCapTiles[tileNum]); } }
private void moveTowardsEnd(float moveAmount) { moveCircles(moveAmount); if (isAtEndPoint()) { Vector2Int coords = Vector2Int.FloorToInt(endTile.getTilePosition()); endTile.addCaptureAmount(bombDamage); tileManager.drawTileCapture(endTile); DestroyEverything(); } }