public TargetAttack(ref global_vars vars, ref Game1 game) : base(game) { this.game = game; this.variables = vars; thisTA = this; }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (Game1 game = new Game1()) { game.Run(); } }
public AutoSave(Delegate notify, double saveTime, Game1 game) { this.notify = notify; timer = new Timer(saveTime, game); timer.Elapsed = SaveDue; timer.Start(); }
public Loader(global_vars.loadType loadtype, ref global_vars vars, ref Game1 game) : base(game) { this.loadtype = loadtype; variables = vars; this.game = game; }
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); }
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; }
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; }
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; }
public Start_Screen(global_vars vars, Game1 game) : base(game) { this.game = game; variables = vars; fadedone = false; alphavalue = 0; alphadec = .50f; }
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); }
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; }
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; }
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; }
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; }
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); }
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; }
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; }
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); } }
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; }
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) { }
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) { }
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(); }
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"); }