Exemplo n.º 1
0
        public WorldEnemy(SpellswordGame game, World gameWorld, Point pointLocation, Character enemy)
        {
            shouldDraw     = true;
            this.game      = game;
            this.gameWorld = gameWorld;
            thisEntity     = enemy;
            if (thisEntity is Character)
            {
                ((Character)thisEntity).Died += OnEntityDied;
            }

            //Temp test
            this.CurrentSprite = game.Content.Load <Texture2D>(enemy.WorldImage);
            this.pointLocation = pointLocation;
            this.Location      = gameWorld.GetTileLocation(pointLocation);
            gameWorld.RegisterEntity(this, pointLocation);
            if (this.thisEntity is Dragon)
            {
                this.Location -= new Vector2(32, 32);
                gameWorld.RegisterEntity(this, new Point(pointLocation.X - 1, pointLocation.Y));
                gameWorld.RegisterEntity(this, new Point(pointLocation.X + 1, pointLocation.Y));
                gameWorld.RegisterEntity(this, new Point(pointLocation.X, pointLocation.Y - 1));
                gameWorld.RegisterEntity(this, new Point(pointLocation.X, pointLocation.Y + 1));
                gameWorld.RegisterEntity(this, new Point(pointLocation.X - 1, pointLocation.Y - 1));
                gameWorld.RegisterEntity(this, new Point(pointLocation.X - 1, pointLocation.Y + 1));
                gameWorld.RegisterEntity(this, new Point(pointLocation.X + 1, pointLocation.Y - 1));
                gameWorld.RegisterEntity(this, new Point(pointLocation.X + 1, pointLocation.Y + 1));
            }
        }
Exemplo n.º 2
0
 public BackCommand(SpellswordGame game, Menu newMenu, Menu oldMenu)
 {
     this.Name        = "Back";
     this.Description = "Go Back";
     this.game        = game;
     this.newMenu     = newMenu;
     this.oldMenu     = oldMenu;
 }
Exemplo n.º 3
0
 public SwitchMenuCommand(string Name, SpellswordGame game, Menu oldMenu, Menu newMenu)
 {
     this.Name        = Name;
     this.Description = "Go to " + newMenu.ToString();
     this.game        = game;
     this.oldMenu     = oldMenu;
     this.newMenu     = newMenu;
 }
Exemplo n.º 4
0
        public StatusMenu(SpellswordGame game, Player player) : base(game, "")
        {
            this.CurrentSprite = game.Content.Load <Texture2D>("Menu");
            this.AnchorTopLeft(game);
            this.player = player;

            this.SwitchOutString(GetPlayerStatus());
        }
Exemplo n.º 5
0
        public TextMenu(SpellswordGame game, List <string> currentText) : base(game)
        {
            this.color    = new Color(Color.Black, 1f);
            CurrentSprite = game.Content.Load <Texture2D>("EquipmentMenu");
            this.AnchorTopRight(game);

            this.currentText = currentText;
        }
Exemplo n.º 6
0
        public RunCommand(SpellswordGame game, Character player, Character enemy)
        {
            this.game   = game;
            this.player = player;
            this.enemy  = enemy;

            Name        = "Run";
            Description = "Run Away";
        }
Exemplo n.º 7
0
        public SwitchWeaponCommand(SpellswordGame game, EquipmentMenu oldMenu, Player player, IWeapon weapon, int weaponIndex)
        {
            this.game        = game;
            this.oldMenu     = oldMenu;
            this.player      = player;
            this.weaponIndex = weaponIndex;

            this.Name        = weapon.Name;
            this.Description = weapon.Description;
        }
Exemplo n.º 8
0
        public TalentMenu(SpellswordGame game, Player player) : base(game)
        {
            this.color    = new Color(Color.Black, 0.85f);
            CurrentSprite = game.Content.Load <Texture2D>("Menu");
            this.AnchorTopLeft(game);

            textMenu = new TextMenu(game, "");

            this.player          = player;
            this.currentCommands = GenerateCommands();
        }
Exemplo n.º 9
0
        public BattleMenu(SpellswordGame game, Character player, Character enemy, IWeapon weapon, List <ISpellswordCommand> commands) : base(game, commands)
        {
            controller = new BattleController(game);

            CurrentSprite = game.Content.Load <Texture2D>("BattleMenu");
            AnchorBottomLeft(game);

            this.player        = player;
            this.enemy         = enemy;
            this.currentWeapon = weapon;
        }
Exemplo n.º 10
0
        public BattlePlayer(SpellswordGame game, BattleScene currentScene, Player player)
        {
            this.CurrentSprite = game.Content.Load <Texture2D>(player.BattleImage);
            this.Location      = Parameters.battlePlayerLocation;

            this.game = game;

            this.currentScene = currentScene;
            this.ThisEntity   = player;

            this.CurrentState = BattlePlayerState.Waiting;
        }
Exemplo n.º 11
0
        public MenuScene(SpellswordGame game, Menu menu)
        {
            inputHandler = game.Services.GetService <InputHandler>();
            if (inputHandler == null)
            {
                inputHandler = new InputHandler(game);
                game.Components.Add(inputHandler);
            }

            this.game   = game;
            currentMenu = menu;
        }
Exemplo n.º 12
0
        public Menu(SpellswordGame game, List <ISpellswordCommand> commands)
        {
            thisGame          = game;
            controller        = new MenuController(game);
            currentCommands   = commands;
            currentTopCommand = 0;

            this.color    = new Color(Color.Black, 0.85f);
            font          = game.Content.Load <SpriteFont>("Arial");
            CurrentSprite = game.Content.Load <Texture2D>("Menu");
            AnchorTopLeft(game);
        }
Exemplo n.º 13
0
        public WorldSword(SpellswordGame game, World gameWorld, Point startingLocation, Weapon thisItem)
        {
            shouldDraw     = true;
            this.game      = game;
            this.gameWorld = gameWorld;

            this.thisEntity = thisItem;

            this.CurrentSprite = game.Content.Load <Texture2D>(thisItem.WorldImage);
            this.pointLocation = startingLocation;
            this.Location      = gameWorld.GetTileLocation(pointLocation);
            gameWorld.RegisterEntity(this, pointLocation);
        }
Exemplo n.º 14
0
        public WalkingPlayer(SpellswordGame game, World gameWorld)
        {
            this.game       = game;
            this.gameWorld  = gameWorld;
            this.thisEntity = new Player("BackwardsStill", "Spellsword");

            animator   = new Animator(game, this);
            controller = new PlayerController(game);
            this.CurrentTileLocation = new Point(8, 21);
            this.Location            = gameWorld.GetTileLocation(CurrentTileLocation);

            CurrentSprite       = game.Content.Load <Texture2D>(((Player)thisEntity).WorldImage);
            CurrentWalkingState = WalkingState.Still;

            MovementQueue = new Stack <Vector2>();
        }
Exemplo n.º 15
0
 public MainMenu(SpellswordGame game, MenuScene scene) : this(game, new List <ISpellswordCommand>())
 {
 }
Exemplo n.º 16
0
 public TextMenu(SpellswordGame game, string currentText) : this(game, new List <string> {
     currentText
 })
 {
 }
Exemplo n.º 17
0
 public EmptyTile(SpellswordGame game, World world, Point pointLocation)
 {
     this.CurrentSprite = game.Content.Load <Texture2D>("EmptyTile");
     this.Location      = world.GetTileLocation(pointLocation);
 }
Exemplo n.º 18
0
 public BattleMenu(SpellswordGame game, Character player, Character enemy, IWeapon weapon) : this(game, player, enemy, weapon, new List <ISpellswordCommand>())
 {
     LoadBasicCommands();
 }
Exemplo n.º 19
0
 public Menu(SpellswordGame game) : this(game, new List <ISpellswordCommand>())
 {
 }
Exemplo n.º 20
0
 public MainMenu(SpellswordGame game, List <ISpellswordCommand> commands) : base(game, commands)
 {
     thisGame = game;
 }
Exemplo n.º 21
0
 static void Main()
 {
     using (var game = new SpellswordGame())
         game.Run();
 }