public void DoAction() { Splittable cube = gameObject.GetComponent <Splittable> (); if (cube) { cube.Split(); } Spawner spawn = gameObject.GetComponent <Spawner> (); if (spawn) { spawn.Spawn(); } Sweeper sweep = gameObject.GetComponent <Sweeper> (); if (sweep) { sweep.Sweep(); } Shotgun shotgun = gameObject.GetComponent <Shotgun> (); if (shotgun) { shotgun.Shoot(); } }
private void SweepCheck() { if (_topDict._sweepRequests == 0) { _topDict._sweepRequests = 1; Sweeper.TryRearm(this); } }
// FixedUpdate is called once for physics frame void FixedUpdate() { if (CurrentGameState == GameState.SWEEPING) { ActiveRock.GetComponent <Rock>().UseReducedFriction = Utils.GetKey_Confirm(); if (Utils.GetKey_Confirm()) { Rigidbody2D rb = ActiveRock.GetComponent <Rigidbody2D>(); rb.velocity += new Vector2(0f, Sweeper.GetComponent <Sweeper>().SweepOffset.y *rb.velocity.magnitude *SWEEP_COEF); } } }
public void AddBombsToGrid_AddsCorrectNumberOfBombs(int width, int height, int totalBombs) { //arrange var sweeper = new Sweeper(width, height); //act sweeper.AddBombsToGrid(totalBombs); //assert var actualBombs = sweeper.GetTtotalBombs(); Assert.That(actualBombs, Is.EqualTo(totalBombs)); }
private static Sweeper SetupBoardBasedOnUserInput() { Console.Clear(); Console.WriteLine("Enter Length:"); int length = Int32.Parse(Console.ReadLine()); Console.WriteLine("Enter Height:"); int height = Int32.Parse(Console.ReadLine()); Console.WriteLine("Enter Total Bombs:"); int totalBombs = Int32.Parse(Console.ReadLine()); var sweeper = new Sweeper(length, height); sweeper.AddBombsToGrid(totalBombs); return(sweeper); }
public static void Run([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer, TraceWriter log) { log.Info($"TTLSweeper function started at: {DateTime.Now}"); CronConfiguration.LocadConfig(); Sweeper sweeper = new Sweeper(log); try { sweeper.RunSweeper(); } catch (Exception ex) { log.Error(ex.ToString()); } log.Info($"TTLSweeper function ended at: {DateTime.Now}"); }
void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); boardScript = GetComponent <BoardManager>(); meleeUnitScript = GetComponent <MeleeUnitManager>(); logicScript = GetComponent <LogicManager>(); sweeperScript = GetComponent <Sweeper>(); InitGame(); }
void Awake() { source = GetComponent <AudioSource>(); player = FindObjectOfType <Player>(); sweeper = FindObjectOfType <Sweeper>(); lives = startingLives; roundTime = 0; enemiesSpawned = 0; spawnPositions = new Vector2[4]; spawnPositions[0] = new Vector2(-5.15f, 2.8f); spawnPositions[1] = new Vector2(5.15f, 2.8f); spawnPositions[2] = new Vector2(-5f, -2.51f); spawnPositions[3] = new Vector2(5f, -2.51f); spawnRotations = new float[4]; spawnRotations[0] = -135; spawnRotations[1] = 135; spawnRotations[2] = -45; spawnRotations[3] = 45; }
void StartThrow() { ActiveRock = Instantiate(RockPrefab); rocks.Add(ActiveRock); ActiveRock.GetComponent <Rock>().Team = GetCurrentTeam(); ActiveRock.GetComponent <Rock>().Minimap = Minimap; ActiveRock.GetComponent <Rock>().InstantiateIndicator(); Thrower.GetComponent <SpriteRenderer>().sprite = GetCurrentTeam().AimSprite; Sweeper.GetComponent <SpriteRenderer>().sprite = GetCurrentTeam().SweepSprite; Sweeper.GetComponent <Sweeper>().ResetOffsets(); trajectory = Instantiate(TrajectoryPrefab); trajectoryIndicator = Instantiate(TrajectoryIndicatorPrefab); trajectory.transform.SetParent(ActiveRock.transform); trajectoryIndicator.transform.SetParent(ActiveRock.GetComponent <Rock>().Indicator.transform); trajectory.transform.localPosition = new Vector3(); trajectoryIndicator.transform.localPosition = new Vector3(); CurrentGameState = GameState.AIMING; if (CurrentTurn == Turn.P1 ? GameConfig.P1ShowTutorial : GameConfig.P2ShowTutorial) { helpStage = HelpScreen.ID.SCORING; } }
private void SetUpGrid(int length, int height) { _sweeper = new Sweeper(length, height); }
public GameView(Sweeper sweeper) { _sweeper = sweeper; }