This is the main type for your game
Inheritance: Microsoft.Xna.Framework.Game
 public BaseAbility(SwordeningGame game,InGame gameState,Vector3 position)
     : base(game)
 {
     _game = game;
     _gameState = gameState;
     Position = position;
 }
Example #2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (SwordeningGame game = new SwordeningGame())
     {
         game.Run();
     }
 }
Example #3
0
        /// <summary>
        /// Creates a new empty grid.
        /// </summary>
        public MapGrid(SwordeningGame game,InGame gameState)
        {
            _game = game;
            _gameState = gameState;

            _tiles = new SerializableDictionary<string, MapTile>();
        }
Example #4
0
 public Creature(SwordeningGame game, InGame gameState, Vector3 position)
     : base(game)
 {
     _game = game;
     _gameState = gameState;
     Position = position;
 }
Example #5
0
 /// <summary>
 /// Default contructor.
 /// </summary>
 /// <param name="game">the XNA game</param>
 /// <param name="gameState">InGame gamestate</param>
 /// <param name="textures">ground texture</param>
 public MapTile(SwordeningGame game, InGame gameState, int x, int z, int[,] grid)
 {
     tileX = x;
     tileZ = z;
     Grid = grid;
     Initialize(game, gameState);
 }
Example #6
0
        /// <summary>
        /// Creates a new live grid.
        /// </summary>
        public LiveGrid(SwordeningGame game, ref MapGrid mapGrid)
            : base(game)
        {
            _mapGrid = mapGrid;

            CoordinateX = 0;
            CoordinateZ = 0;
            UpdateGrid();
        }
Example #7
0
 public InGame(SwordeningGame game)
     : base(game)
 {
     Hero = new Wizard(game,this,Vector3.Zero);
     camera = new CameraAndLights();
     _saveGame = new SaveGame(this);
     mapGrid = new MapGrid(_game,this);
     liveGrid = new LiveGrid(_game,ref mapGrid);
     monsters = new List<Creature>();
     camera.cameraPos = Vector3.Zero;
     gamemusic = _game.musics["gamemusic"];
     difficultycounter = 0;
     spawntime = 1.0f;
 }
 public WeakSkeleton(SwordeningGame game,InGame gameState,Vector3 position)
     : base(game,gameState,position)
 {
     //modifiers inherited from Creature:
     name = "Homicidal skeleton";
     movementSpeedFactor = 0.85f;
     attackSpeedFactor = 0.7;
     CurrentHitPoints = 3;
     MaxHitPoints = 3;
     MaxMana = 0;
     CurrentMana = 0;
     camera = camera;
     graphics = graphics;
     Rotation = Quaternion.Identity;
     exp = 100;
     //modifiers inherited from Monster:
     loot = lootRandomiser.Next(1, 4);
     basedmg = 1;
 }
Example #9
0
        public Wizard(SwordeningGame game, InGame gameState, Vector3 position)
            : base(game,gameState,position)
        {
            //modifiers inherited from Creature:

            name = "Saruman of Many Colors";
            Rotation = Quaternion.Identity;
            previousFireTime = TimeSpan.Zero;
            movementSpeedFactor = 1;
            attackSpeedFactor = 1;
            CurrentHitPoints = 10;
            MaxHitPoints = 10;
            MaxMana = 30;
            CurrentMana = 30;
            ManaRegenPerTick = 1;
            exp = 0;
            tnl = 1000;
            level = 1;
            //modifiers inherited from Hero
            gold = 0; //Our hero is the 99%. :<
        }
Example #10
0
        /// <summary>
        /// Separated from constructor for deserialization.
        /// </summary>
        /// <param name="game">the XNA game</param>
        /// <param name="gameState">InGame gamestate</param>
        /// <param name="textures">ground texture</param>
        public void Initialize(SwordeningGame game, InGame gameState)
        {
            _game = game;
            _graphics = game.Graphics;
            _gameState = gameState;
            camera = gameState.camera;
            effects = game.Services.GetService(typeof(Effect)) as Effect;
            _tileVertexBufferDict = new Dictionary<TileType,VertexBuffer>();
            _textures = new Dictionary<TileType,Texture2D>();

            SetUpTextures();
            SetUpVertices();
        }
 public Initialize(SwordeningGame game)
     : base(game)
 {
 }
Example #12
0
 public InMenus(SwordeningGame game)
     : base(game)
 {
     menuMap = new Dictionary<Menus,GameComponent>();
 }
Example #13
0
 public MainMenu(SwordeningGame game,InMenus gameState)
     : base(game,gameState)
 {
 }
Example #14
0
 public GameState(SwordeningGame game)
     : base(game)
 {
     _game = game;
 }
Example #15
0
 public Fireball(SwordeningGame game,InGame gameState,Vector3 position)
     : base(game,gameState,position)
 {
     ManaCost = 2;
     MovementSpeed = 4.0f;
 }
 /// <summary>
 /// Constructs the handler.
 /// </summary>
 /// <param name="game">the XNA game</param>
 public GameStateHandler(SwordeningGame game)
 {
     _game = game;
 }
 public AbstractMenu(SwordeningGame game,InMenus gameState)
     : base(game)
 {
     _game = game;
     _gameState = gameState;
 }
        /// <summary>
        /// Creates a MapTile.
        /// </summary>
        /// <returns></returns>
        public static MapTile CreateMapTile(SwordeningGame game,InGame gameState, int x, int z)
        {
            int[,] grid = new[,]
            {
                 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0},
                 {0,0,0,1,1,0,0,0,1,1,0,0,1,0,0,0,0,1,1,0},
                 {1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0},
                 {0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0},
                 {0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0},
                 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0},
                 {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                 {0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0},
                 {0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0},
                 {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0},
                 {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0},
                 {1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                 {0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,1,0,0,0,0},
                 {0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0},
                 {0,0,1,1,0,0,0,0,1,1,0,0,0,1,1,1,1,0,0,0},
                 {1,1,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0},
                 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
            };

            if (RANDOM_TILES)
            {
                var rand = new Random();

                for (int i = 0; i < grid.GetLength(0); i++)
                {
                    for (int j = 0; j < grid.GetLength(1); j++)
                    {
                        if (rand.Next() % 4 == 0)
                            grid[i,j] = 1;
                        else
                            grid[i,j] = 0;
                    }
                }
            }

            MapTile newTile = new MapTile(game,gameState,x,z,grid);

            /*
            int objectAmount = 5 + rand.Next() % 3;
            var takenSpots = new bool[objectAmount, objectAmount];
            int differenceX = MapTile.Width / (objectAmount + 2);
            int differenceY = MapTile.Length / (objectAmount + 2);

            for (int i = 0; i < objectAmount; i++)
            {
                int x = rand.Next() % objectAmount;
                int y = rand.Next() % objectAmount;
                while (!takenSpots[x,y])
                {
                    x = rand.Next() % objectAmount;
                    y = rand.Next() % objectAmount;
                }
                takenSpots[x,y] = true;
                x++;
                y++;
                x *= differenceX;
                y *= differenceY;

                var size = (StationaryObject.Size)(rand.Next() % 3 + 1);

                StationaryObject stationary = new StationaryRockSmall(game);
                stationary.SetPosition(x,y);
                stationary.Theme = theme;
                stationary.Name = StationaryObject.NewStationaryID();

                newTile.AddStationary(stationary);
            }*/

            return newTile;
        }
 public MissileSpell(SwordeningGame game,InGame gameState,Vector3 position)
     : base(game,gameState,position)
 {
 }
Example #20
0
 public Attack(SwordeningGame game,InGame gameState,Vector3 position)
     : base(game,gameState,position)
 {
 }
Example #21
0
 public Utility(SwordeningGame game,InGame gameState,Vector3 position)
     : base(game,gameState,position)
 {
 }
Example #22
0
 public Monster(SwordeningGame game,InGame gameState,Vector3 position)
     : base(game,gameState,position)
 {
     lootRandomiser = new Random();
 }