Exemple #1
0
 public GameObject CreateHouse(Color houseColor, Vector2 houseLocation)
 {
     GameObject house = new GameObject(base.Game, houseLocation, 50, 50);
     GameObjectView houseView = new GameObjectView(base.Game, Content.House, houseColor, SpriteBatch, house, ZIndexManager.getZIndex(ZIndexManager.drawnItemOrders.house));
     base.Game.Components.Add(house);
     base.Game.Components.Add(houseView);
     return house;
 }
Exemple #2
0
 public Island CreateIsland(Vector2 position, int goldAmount)
 {
     Island island = new Island(base.Game, position, goldAmount);
     GameObjectView islandView = new GameObjectView(base.Game, Content.Island, Color.White, SpriteBatch, island, ZIndexManager.getZIndex(ZIndexManager.drawnItemOrders.island));
     base.Game.Components.Add(island);
     base.Game.Components.Add(islandView);
     return island;
 }
        public CannonBall CreateCannonBall(Vector2 position, Vector2 firingForce, int collisionGroup)
        {
            var cannonBall = new CannonBall(this.Game, position, collisionGroup);
            var cannonBallView = new GameObjectView(base.Game, Content.CannonBall, Color.White, spriteBatch, cannonBall, ZIndexManager.getZIndex(ZIndexManager.drawnItemOrders.cannonBall));
            base.Game.Components.Add(cannonBall);
            base.Game.Components.Add(cannonBallView);
            cannonBall.ApplyFiringForce(firingForce);
            cannonBalls.Add(cannonBall);

            return cannonBall;
        }