public override void Collide() { do { position = GameSystem.SetPosition(random.Next(3) + random.NextDouble() - 0.255, random.Next(3) + random.NextDouble() - 0.325); } while (position.X < 0.22 * GameSystem.screen.Width || position.Y < 0.27 * GameSystem.screen.Height); }
public Food(PictureBox picBoxBg) : base(picBoxBg) { random = new Random(Guid.NewGuid().GetHashCode()); do { position = GameSystem.SetPosition(random.Next(3) + random.NextDouble() - 0.255, random.Next(3) + random.NextDouble() - 0.325); } while (position.X < 0.22 * GameSystem.screen.Width || position.Y < 0.27 * GameSystem.screen.Height); GameSystem.foods.Add(this); }
public Chapter(PictureBox picBoxStage) { GameSystem.chapter = this; threadAct = new Thread(GameSystem.Act); threadCollide = new Thread(GameSystem.CollisionDetect); background = new Background(picBoxStage); player = new Player(picBoxStage, GameSystem.SetPosition(1.5, 1.5)); pPlantWall = new List <Point>(); pTracker = new List <Point>(); pShocker = new List <Point>(); pPredator = new List <Point>(); pVirus = new List <Point>(); pCompetitor = new List <Point>(); pCompetitorToBeAdded = new List <Point>(); food = new List <Food>(); competitors = new List <Competitor>(); otherCells = new List <Cell>(); organella = new List <Organelle>(); GetReady(); for (int i = 0; i < 45; i++) { food.Add(new Algae(picBoxStage)); food.Add(new Charophyta(picBoxStage)); } for (int i = 0; i < pPlantWall.Count; i++) { otherCells.Add(new PlantWall(picBoxStage, pPlantWall[i])); } for (int i = 0; i < pTracker.Count; i++) { otherCells.Add(new Tracker(picBoxStage, pTracker[i])); } for (int i = 0; i < pShocker.Count; i++) { otherCells.Add(new Shocker(picBoxStage, pShocker[i])); } for (int i = 0; i < pPredator.Count; i++) { otherCells.Add(new Predator(picBoxStage, pPredator[i])); } for (int i = 0; i < pVirus.Count; i++) { otherCells.Add(new Virus(picBoxStage, pVirus[i])); } for (int i = 0; i < pCompetitor.Count; i++) { competitors.Add(new Competitor(picBoxStage, pCompetitor[i])); } organella.Add(new Mitochondria(picBoxStage, GameSystem.SetPosition(0.31, 0.31))); }
protected void SetBorderPosition() { int width = GameSystem.screen.Width; int height = GameSystem.screen.Height; for (double x = 0; x < 15; x += 0.2) { pPlantWall.Add(GameSystem.SetPosition(x, 0)); pPlantWall.Add(GameSystem.SetPosition(x, 2.75)); } for (double y = 0; y < 10; y += 0.25) { pPlantWall.Add(GameSystem.SetPosition(0, y)); pPlantWall.Add(GameSystem.SetPosition(2.8, y)); } }
public virtual void ShowCentromere() { organella.Add(new Centromere(GameSystem.picBoxStage, GameSystem.SetPosition(0.31, 2.6))); GameSystem.formStage.Invoke((Action) delegate() { GameSystem.formStage.NextTargetInMap("Centromere"); }); }
public virtual void ShowER() { organella.Add(new ER(GameSystem.picBoxStage, GameSystem.SetPosition(2.6, 2.6))); GameSystem.formStage.Invoke((Action) delegate() { GameSystem.formStage.NextTargetInMap("ER"); }); }
public virtual void ShowLysosome() { organella.Add(new Lysosome(GameSystem.picBoxStage, GameSystem.SetPosition(2.6, 0.31))); GameSystem.formStage.Invoke((Action) delegate() { GameSystem.formStage.NextTargetInMap("Lysosome"); }); }