//GameData m_Data = new GameData(); public override void Start() { m_LargeRocks = new List <Rock>(); m_MedRocks = new List <Rock>(); m_SmallRocks = new List <Rock>(); m_RockPrefab = Content.Load <Prefab>("Asteroid"); m_PlayerPrefab = Content.Load <Prefab>("Player"); m_UFOPrefab = Content.Load <Prefab>("UFO"); Entity player = m_PlayerPrefab.Instantiate().First(); SceneSystem.SceneInstance.RootScene.Entities.Add(player); m_Player = player.Components.Get <Player>(); m_Player.Initilize(m_Random); Entity ufo = m_UFOPrefab.Instantiate().First();; SceneSystem.SceneInstance.RootScene.Entities.Add(ufo); m_UFO = ufo.Components.Get <UFO>(); m_UFO.Initialize(m_Player, m_Random); SpawnLargeRocks(m_LargeRockCount); m_Background = Content.Load <Sound>("Background").CreateInstance(); m_Background.Volume = 0.50f; }
public void Initialize(Random random, Player player, UFO UFO) { m_Radius = 2.9f; m_Player = player; m_UFO = UFO; m_Points = 20; m_Random = random; int m_RockType = random.Next(0, 4); if (m_RockType == 1) { m_RockOne(); } else if (m_RockType == 2) { m_RockTwo(); } else if (m_RockType == 3) { m_RockThree(); } else { m_RockFour(); } m_Rock = new Entity(); m_Rock.Add(m_RockMesh); this.Entity.AddChild(m_Rock); }
public void ReturnScoreDeadUFO() { var ufo = new UFO(new Point(1, 1), 10); ufo.RemoveLife(); Assert.AreEqual(10, ufo.ReturnScore()); }
public void RemoveLife() { var ufo = new UFO(new Point(1, 1), 10); ufo.RemoveLife(); Assert.AreEqual(0, ufo.CountLife); }
public void CheckIsDead() { var ufo = new UFO(new Point(1, 1), 10); Assert.AreEqual(false, ufo.IsDead); ufo.RemoveLife(); Assert.AreEqual(true, ufo.IsDead); }
private void SpawnUFO() { UFO ufo = m_ufoFactory.Create(); var ufoType = RandomEnum <UFOType> .Get(); var score = m_ufoDataFactory.GetScore(ufoType); var ufoData = m_ufoDataFactory.GetData(ufoType); ufo.Score = score; ufo.transform.position = GetRandomStartPosition(ufo.Scale); }
public void Spawn(Vector3 position, float scale, float speed, int points, Random random, Player player, UFO UFO) { Initialize(random, player, UFO); m_Speed = speed; Spawn(position); m_Rock.Transform.Scale = new Vector3(scale); m_Radius = m_Radius * scale; m_Points = points; }
public static void SetUFOToPool(UFO ufo) { Instance.m_ufoSpawner.SetObjectToPool(ufo); }
public void ReturnScoreNotDeadUFO() { var ufo = new UFO(new Point(1, 1), 10); Assert.AreEqual(0, ufo.ReturnScore()); }