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