예제 #1
0
 public TargetAttack(ref global_vars vars, ref Game1 game)
     : base(game)
 {
     this.game = game;
     this.variables = vars;
     thisTA = this;
 }
예제 #2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
예제 #3
0
 public AutoSave(Delegate notify, double saveTime, Game1 game)
 {
     this.notify = notify;
     timer = new Timer(saveTime, game);
     timer.Elapsed = SaveDue;
     timer.Start();
 }
예제 #4
0
파일: Loader.cs 프로젝트: jbornemann/Ascian
 public Loader(global_vars.loadType loadtype, ref global_vars vars, ref Game1 game)
     : base(game)
 {
     this.loadtype = loadtype;
     variables = vars;
     this.game = game;
 }
예제 #5
0
 public Credits(ref global_vars vars, ref Game1 game)
     : base(game)
 {
     this.game = game;
     this.variables = vars;
     thisCredit = this;
     area = new Rectangle(0, 0, variables.screen_width, variables.screen_height);
 }
예제 #6
0
 public IceAttack(ref global_vars vars, ref Game1 game)
     : base(ref vars, ref game)
 {
     setUp = false;
     duration = new Timer(8000);
     duration.Elapsed += new ElapsedEventHandler(unfreeze);
     duration.AutoReset = false;
 }
예제 #7
0
 public SmokeAttack(ref global_vars vars, ref Game1 game)
     : base(ref vars, ref game)
 {
     started = false;
     duration = new Timer(8000);
     duration.Elapsed += new ElapsedEventHandler(disable);
     duration.AutoReset = false;
 }
예제 #8
0
파일: Target.cs 프로젝트: jbornemann/Ascian
 public Target(ref TargetAttack ta, ref global_vars vars, ref Game1 game)
     : base(game)
 {
     this.game = game;
     this.variables = vars;
     thisTarget = this;
     position = new Rectangle(vars.screen_width/2, vars.screen_height/2, 100, 100);
     attack = ta;
 }
예제 #9
0
 public Start_Screen(global_vars vars, Game1 game)
     : base(game)
 {
     this.game = game;
     variables = vars;
     fadedone = false;
     alphavalue = 0;
     alphadec = .50f;
 }
예제 #10
0
파일: Player.cs 프로젝트: jbornemann/Ascian
 public Player(ref global_vars vars, int experience, String[] special, String selectedSpecial, int game_credit, ref Game1 g)
 {
     this.experience = experience;
     this.avaliableSpecials = special;
     this.game_credit = game_credit;
     variables = vars;
     game = g;
     this.selectedSpecial = selectedSpecial;
     character = new Character(selectedSpecial, ref variables, ref g);
 }
예제 #11
0
파일: Enemy.cs 프로젝트: jbornemann/Ascian
 public Enemy(ref global_vars variables, Texture2D enemysprite, ref Character player_char, ref Campaign currentCampaign,  Game1 game)
     : base(game)
 {
     this.enemy = enemysprite;
     this.player = player_char;
     this.variables = variables;
     this.game = game;
     this.currentCampaign = currentCampaign;
     thisEnemy = this;
 }
예제 #12
0
 public Main_Menu(global_vars vars, Game1 game)
     : base(game)
 {
     this.game = game;
     thisMain = this;
     selection_delay = vars.MENU_DELAY;
     current_delay = selection_delay;
     variables = vars;
     optionselected = option.campaign;
     deviceSelected = false;
 }
예제 #13
0
파일: Pause.cs 프로젝트: jbornemann/Ascian
 public Pause(ref global_vars vars, ref Playable playmode, ref Game1 game)
     : base(game)
 {
     this.game = game;
     this.playmode = playmode;
     thisPause = this;
     variables = vars;
     HUDLocation = variables.HUDLOC;
     layoverPosition = new Rectangle(0, 0, variables.screen_width, variables.screen_height);
     pauseTimer = new Timer(vars.PAUSE_DELAY, game);
     pauseTimer.Elapsed = pauseDelay;
 }
예제 #14
0
        Shield thisShield; //Copy of this implementation of Shield interace, so that it may be passed as ref

        #endregion Fields

        #region Constructors

        public Basic_Shield(int timeAvaliable, Rectangle positionPlaced, ref Character castee, ref global_vars variables, ref Game1 game)
            : base(game)
        {
            this.position = positionPlaced;
            this.castee = castee;
            shieldBatch = new SpriteBatch(game.GraphicsDevice);
            thisShield = this;

            active = new Timer(timeAvaliable);
            active.Elapsed += new ElapsedEventHandler(timeElapsed);
            activate = true;
        }
예제 #15
0
        public Character(String special_ability, ref global_vars vars, ref Game1 game)
            : base(game)
        {
            this.game = game;
            thisCharacter = this;
            this.variables = vars;

            this.special_ability = special_ability;
            this.position = new Rectangle(variables.CHARACTER_START_POSITION.X, variables.CHARACTER_START_POSITION.Y, variables.CHARACTER_WIDTH, variables.CHARACTER_HEIGHT);

            base.UpdateOrder = variables.CHARACTER_UPDATE_PRIORITY;
            base.DrawOrder = variables.CHARACTER_UPDATE_PRIORITY;

            this.move_state = variables.CHARACTER_DEFAULT_MOVESTATE;
            this.charsprite = new SpriteBatch(variables.manager.GraphicsDevice);

            attackDelayTimer = new Timer(variables.ATTACK_DELAY);
            attackDelayTimer.Elapsed += new ElapsedEventHandler(attackIsReady);
        }
예제 #16
0
        public Upgrade(Dictionary<String, Texture2D[]> texPack, Texture2D overlay, Texture2D defaultSelection, Player player, ref global_vars vars, ref Game1 game)
            : base(game)
        {
            this.currentSlot = 0;
            this.texturePack = texPack;
            this.overlay = overlay;
            this.player = player;
            this.variables = vars;
            this.game = game;
            this.defaultSelection = defaultSelection;
            this.selection = defaultSelection;
            thisUpgrade = this;

            pointLoc = variables.PLOC;
            costLoc = variables.CLOC;

            layoverPosition = new Rectangle(0, 0, vars.screen_width, vars.screen_height);
            selectionDelay = new Timer(vars.UPGRADE_DELAY, game);
            selectionDelay.Elapsed = selectDelay;
        }
예제 #17
0
        public Campaign(ref global_vars vars, Player player, Texture2D map, Game1 game)
            : base(game)
        {
            this.variables = vars;
            this.player = player;
            this.map = map;
            this.game = game;
            thisCampaign = this;
            play = this;

            s1 = new Vector2(40, variables.screen_height - 40);
            l1 = new Rectangle(variables.screen_width - 190, variables.screen_height - 70, 50, 50);
            l2 = new Rectangle(variables.screen_width - 130, variables.screen_height - 70, 50, 50);
            l3 = new Rectangle(variables.screen_width - 70, variables.screen_height - 70, 50, 50);

            mapPosition = new Rectangle(0, 0, variables.screen_width, variables.screen_height);
            this.character = this.player.getCharacter(thisCampaign);
            creepers = 0;
            shadows = 0;
        }
예제 #18
0
 public static void performSpecialAbility(String identifier, ref global_vars vars, ref Game1 game)
 {
     //Account for null (AKA No Special Ability)
     if (identifier == null)
         return;
     //Fire
     else if(identifier.Equals(vars.ABIL_ONE))
     {
         FireWave f = new FireWave(5000, new Rectangle(0, 0, 50, vars.screen_height), 'r', global_vars.sender.Special, ref vars, ref game);
         game.Components.Add(f);
     }
     //Ice
     else if(identifier.Equals(vars.ABIL_TWO))
     {
         IceAttack ia = new IceAttack(ref vars, ref game);
         game.Components.Add(ia);
     }
     //Smoke
     else if(identifier.Equals(vars.ABIL_THREE))
     {
         SmokeAttack ms = new SmokeAttack(ref vars, ref game);
         game.Components.Add(ms);
     }
 }
예제 #19
0
 public FireWave(int timeAvaliable, Rectangle startpos, char direction, global_vars.sender sender, ref global_vars variables, ref Game1 game)
     : base(timeAvaliable, startpos, direction, sender, ref variables, ref game)
 {
     thisFirewave = this;
 }
예제 #20
0
 public Shadow_Basic_Attack(int timeAvaliable, Rectangle startpos, char direction, global_vars.sender sender, ref global_vars variables, ref Game1 game)
     : base(timeAvaliable, startpos, direction, sender, ref variables, ref game)
 {
 }
예제 #21
0
 public Creeper(ref global_vars variables, Texture2D enemysprite, ref Character player_char, ref Campaign currentCampaign, Game1 game)
     : base(ref variables, enemysprite, ref player_char, ref currentCampaign, game)
 {
 }
예제 #22
0
        public static void handleCommand(ref Character character, ref Playable playable, ref global_vars variables, ref Game1 game)
        {
            keypressed = Keyboard.GetState();

            //Player movement

            if (keypressed.IsKeyDown(variables.CHARACTER_UP) && (character.getPosition().Y > 0))
            {
                character.setPosition(character.getPosition().X, character.getPosition().Y - variables.CHARACTER_DEFAULT_MOVE_SPEED);
                character.move_state = global_vars.movestate.up;
            }
            else if (keypressed.IsKeyDown(variables.CHARACTER_DOWN) && (character.getPosition().Y < (variables.screen_height - variables.CHARACTER_HEIGHT)))
            {
                character.setPosition(character.getPosition().X, character.getPosition().Y + variables.CHARACTER_DEFAULT_MOVE_SPEED);
                character.move_state = global_vars.movestate.down;
            }
            else if (keypressed.IsKeyDown(variables.CHARACTER_RIGHT) && (character.getPosition().X < variables.screen_width - variables.CHARACTER_WIDTH))
            {
                character.setPosition(character.getPosition().X + variables.CHARACTER_DEFAULT_MOVE_SPEED, character.getPosition().Y);
                character.move_state = global_vars.movestate.right;
            }
            else if (keypressed.IsKeyDown(variables.CHARACTER_LEFT) && (character.getPosition().X > 0))
            {
                character.setPosition(character.getPosition().X - variables.CHARACTER_DEFAULT_MOVE_SPEED, character.getPosition().Y);
                character.move_state = global_vars.movestate.left;
            }

            else character.move_state = global_vars.movestate.notmoving;

            //User commands (spells, shields, etc)
            //Attacks start at player's center
            int posx = character.getPosition().X + (variables.CHARACTER_WIDTH / 4);
            int posy = character.getPosition().Y + (variables.CHARACTER_HEIGHT / 4);
            int shieldx = character.getPosition().X - (variables.SHIELD_WIDTH / 2);
            int shieldy = character.getPosition().Y - (variables.SHIELD_HEIGHT / 2);

            //Sheild (One at a time)
            if (keypressed.IsKeyDown(variables.SHIELD) && (character.shieldOut == false))
            {
                try
                {
                    bool answer = playable.notify(global_vars.notification.ShieldRequest);
                    if (answer)
                    {
                        character.shieldOut = true;
                        game.Components.Add(new Basic_Shield(10000, new Rectangle(shieldx, shieldy, variables.SHIELD_WIDTH, variables.SHIELD_HEIGHT), ref character, ref variables, ref game));
                    }
                }
                catch (Exception e) { throw e; }
            }

            //Basic Attack
            if (keypressed.IsKeyDown(variables.ATTACK_BASIC_UP) && (character.attackReady == true))
            {
                character.attackReady = false;
                game.Components.Add(new Basic_Attack(3000, new Rectangle(posx, posy, variables.ATTACK_SPELL_SIZE, variables.ATTACK_SPELL_SIZE), 'u', global_vars.sender.Character, ref variables, ref game));
            }
            else if (keypressed.IsKeyDown(variables.ATTACK_BASIC_RIGHT) && (character.attackReady == true))
            {
                character.attackReady = false;
                game.Components.Add(new Basic_Attack(3000, new Rectangle(posx, posy, variables.ATTACK_SPELL_SIZE, variables.ATTACK_SPELL_SIZE), 'r', global_vars.sender.Character, ref variables, ref game));
            }
            else if (keypressed.IsKeyDown(variables.ATTACK_BASIC_LEFT) && (character.attackReady == true))
            {
                character.attackReady = false;
                game.Components.Add(new Basic_Attack(3000, new Rectangle(posx, posy, variables.ATTACK_SPELL_SIZE, variables.ATTACK_SPELL_SIZE), 'l', global_vars.sender.Character, ref variables, ref game));
            }
            else if (keypressed.IsKeyDown(variables.ATTACK_BASIC_DOWN) && (character.attackReady == true))
            {
                character.attackReady = false;
                game.Components.Add(new Basic_Attack(3000, new Rectangle(posx, posy, variables.ATTACK_SPELL_SIZE, variables.ATTACK_SPELL_SIZE), 'd', global_vars.sender.Character, ref variables, ref game));
            }

            //Special Ability
            if (keypressed.IsKeyDown(variables.SPECIAL_ABILITY))
            {
                try
                {
                    bool answer = playable.notify(global_vars.notification.SpecialRequest);
                    if (answer)
                    {
                        Ability_Manager.performSpecialAbility(character.getSpecial(), ref variables, ref game);
                    }
                }
                catch (Exception e) { }
            }

            //Exit Full Screen
               // if (keypressed.IsKeyDown(Keys.Escape))
              //      variables.manager.ToggleFullScreen();
        }
예제 #23
0
 public ShadowEater(ref global_vars variables, Texture2D enemysprite, ref Character player_char, ref Campaign currentCampaign, Game1 game)
     : base(ref variables, enemysprite, ref player_char, ref currentCampaign, game)
 {
     attackSound = game.Content.Load<SoundEffect>("Sounds\\shadowAttackSound");
 }