private void HandleFriendly(Point currentPoint, Color dotColor, Color[] colorData, Level level) { Point position = GetCenterPoint(currentPoint, dotColor, colorData); GoodCell goodCell = new GoodCell(PlayWindow, PointToPosition(position)); level.AddFriendly(goodCell); }
static public void LoadContent(GraphicsDevice graphicsDevice) { PlayerCell.LoadContent(graphicsDevice); GoodCell.LoadContent(graphicsDevice); Virus.LoadContent(graphicsDevice); BackgroundObjectsHandler.LoadContet(); Wall.LoadContent(); }
private bool AABBCollision(Fixture f) { Object o = f.Body.UserData; if (o == null) return true; if (o is GoodCell) { GoodCell cell = (GoodCell)o; float distance = (Owner.Position - cell.Position).LengthSquared(); if (closestDistance > distance) { closestDistance = distance; closestTarget = cell; } targetFound = true; } return true; }
private void TestInit() { World = new World(Vector2.Zero); _objectList = new List <ActiveGameObject>(); _player = new PlayerCell(this, new Vector2(0)); GoodCell goodCell = new GoodCell(this, new Vector2(300, 100)); GoodCellList.Add(goodCell); _objectList.Add(goodCell); _objectList.Add(new Virus(this, new Vector2(200, -200))); //Vertices vertices = new Vertices(); //vertices.Add(new Vector2(-300, -200)); //vertices.Add(new Vector2(-200, -150)); //vertices.Add(new Vector2(-100, -200)); //vertices.Add(new Vector2(-160, -300)); //vertices.Add(new Vector2(-240, -300)); //_wallList.Add(new Wall(vertices, Wall.WallType.Outer, this)); Vertices vertices = new Vertices(); vertices.Add(new Vector2(-200, 200)); vertices.Add(new Vector2(-150, 225)); vertices.Add(new Vector2(-100, 200)); vertices.Add(new Vector2(-125, 250)); vertices.Add(new Vector2(-100, 300)); vertices.Add(new Vector2(-150, 275)); vertices.Add(new Vector2(-200, 300)); vertices.Add(new Vector2(-175, 250)); _wallList.Add(new Wall(vertices, Wall.WallType.Outer, this)); }
public void RemoveGoodCell(GoodCell goodCell) { GoodCellList.Remove(goodCell); _removeList.Add(goodCell); goodCell.UpForRemoval = true; }
public void RegisterGoodCell(GoodCell goodCell) { _addList.Add(goodCell); }