public Duel(string mapaEscolhido) { fight = Game1.sContent.Load <Texture2D>("Fight"); fightRect = new Rectangle(fight.Bounds.X, fight.Bounds.Y, fight.Width + 416, fight.Height); fightPosition = new Vector2(Game1.mGraphics.PreferredBackBufferWidth / 2 - fight.Width / 2, Game1.mGraphics.PreferredBackBufferHeight / 2 - fight.Height / 2); /////////////////////////////////////////////////// win1 = Game1.sContent.Load <Texture2D>("P1WIN"); win1Rect = new Rectangle(win1.Bounds.X, win1.Bounds.Y, win1.Width, win1.Height); win2 = Game1.sContent.Load <Texture2D>("P2WIN"); win2Rect = new Rectangle(win2.Bounds.X, win2.Bounds.Y, win2.Width, win2.Height); winPosition = new Vector2(Game1.mGraphics.PreferredBackBufferWidth / 2 - win2.Width / 2, Game1.mGraphics.PreferredBackBufferHeight / 2 - win2.Height / 2); ////////////////////////////////////////////////// this.nomeMapa = mapaEscolhido; mapa = new Map(mapaSize, mapaPosition, nomeMapa); timUI = new TimerUI(new Vector2(Game1.mGraphics.PreferredBackBufferWidth, Game1.mGraphics.PreferredBackBufferHeight / 2), Game1.mGraphics.PreferredBackBufferWidth, Game1.mGraphics.PreferredBackBufferHeight); /*timer = new GameTimer(180.0f); * timer.Font = Game1.sContent.Load<SpriteFont>("Arial"); * timer.Position = new Vector2((Game1.mGraphics.PreferredBackBufferWidth / 2) - timer.Font.MeasureString(timer.Text).X / 2, 0);*/ if (nomeMapa.Equals("map1")) { charP.X = 200; charP.Y = 1000; char2P.X = 2500; char2P.Y = 1000; } else if (nomeMapa.Equals("map2")) { charP.X = 500; charP.Y = 750; char2P.X = 2200; char2P.Y = 750; } attacksPlayer1 = new AttackList(); player1 = new Character("SpriteBrazilianRyu", charP, charS, 18, 32, 0, 1, SpriteEffects.None, false, mapa.ListaPlataformas, attacksPlayer1); attacksPlayer2 = new AttackList(); player2 = new Character("SpriteBlackGayRyu", char2P, charS, 18, 32, 0, 2, SpriteEffects.FlipHorizontally, false, mapa.ListaPlataformas, attacksPlayer2); player1.SetInimigo(attacksPlayer2, player2.listHadouken); player2.SetInimigo(attacksPlayer1, player1.listHadouken); }
public Character(string imageName, Vector2 cposition, Vector2 csize, int row, int col, int padding, int player, SpriteEffects effect, bool ai, List <Plataforma> mapa, AttackList attacks) : base(imageName, cposition, csize, row, col, padding, effect) { mCurrentCharState = CharState.Idle; SetSpriteAnimation(0, 0, 0, 17, 2); position = cposition; size = csize; isGrounded = false; hasAirJump = true; isAttacking = false; isAI = ai; playerNumber = player; valorX = 0f; valorY = 0f; xSpeed = 10f; jumpSpeed = 40f; gravity = 2f; fallingSpeedLimiter = -40f; animationPlay = false; playerHealth = 100; airJumpCounter = 0; airJumpDelay = 12; SetKeys(); this.mapa = mapa; this.attacks = attacks; movementKeyHistory = new Queue <Keys>(); isRightDown = false; isLeftDown = false; isDownDown = false; hasHadouken = false; isCrouched = false; comboCounter = 0; comboDelay = 50; invulFrames = 60; listHadouken = new List <Projectil>(); this.effect = effect; }
public Character(string imageName, Vector2 cposition, Vector2 csize, List <Plataforma> mapa) : base(imageName, cposition, csize, 18, 32, 0, SpriteEffects.None) { playerNumber = 1; mCurrentCharState = CharState.Idle; SetSpriteAnimation(0, 0, 0, 17, 2); position = cposition; size = csize; isGrounded = false; hasAirJump = true; isAttacking = false; valorX = 0f; valorY = 0f; xSpeed = 10f; jumpSpeed = 40f; gravity = 2f; fallingSpeedLimiter = -40f; animationPlay = false; airJumpCounter = 0; airJumpDelay = 12; SetKeys(); this.mapa = mapa; movementKeyHistory = new Queue <Keys>(); isRightDown = false; isLeftDown = false; isDownDown = false; hasHadouken = false; isCrouched = false; comboCounter = 0; comboDelay = 50; invulFrames = 60; attacks = new AttackList(); listHadouken = new List <Projectil>(); inimigoAttackList = new AttackList(); hInimigo = new List <Projectil>(); this.effect = SpriteEffects.None; }
public void SetInimigo(AttackList inimigo, List <Projectil> hInimigo) { this.inimigoAttackList = inimigo; this.hInimigo = hInimigo; }