public SceneExtras(Rectangle windowSize, KeyboardState keyboardState, MouseState mouseState) { _windowSize = windowSize; _mouseState = mouseState; _keyboardState = keyboardState; selectedSprite = 0; currentSize = 150; tailleSelection = new Sprite(new Rectangle(0, _windowSize.Height - 85, windowSize.Width, 85), windowSize); mouse = new AnimatedSprite(new Rectangle(-100, -100, 60, 80), _windowSize, 8, 4, 30); animations = new List<AnimatedSprite>(); menu = new ContextMenu(_windowSize, new AnimatedSprite(new Rectangle(200, 50, 300, 50), _windowSize, "menu/ContextualMenuBlackFull"), "menu/contextMenuExit", 100); menu.Title = new AnimatedSprite(new Rectangle(menu.Position.Width / 2 - 75, 0, 150, 50), _windowSize, "menu/contextMenuText"); menu.Visible = false; menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/canalisation1_16x13", 16, 13)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion0_8x6", 8, 6)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion1_8x6", 8, 6)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion2_8x8", 8, 8)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion3_8x4", 8, 4)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion4_8x8", 8, 8)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/fireWall_11x6r23r44", 11, 6)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/popGreen_8x4", 8, 4)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/spriteElectric_11x3r12r23", 11, 3)); menu.CuadricPositionning(new Rectangle(0, 0, 75, 75), 100, 20, 3, 3, true); menu.Add(new AnimatedSprite(new Rectangle(menu.Position.Width / 2 - 100, 65, 200, 22), _windowSize, "menu/contextMenuTextMainMenu")); }
public MainMenu(Rectangle windowSize, KeyboardState newKeyboardState, MouseState newMouseState) { windowWidth = windowSize.Width; windowHeight = windowSize.Height; keyboardState = newKeyboardState; mousestate = newMouseState; selection = Selection.Play; wallpaper = new Sprite(new Rectangle(0, 0, windowWidth, windowHeight), windowSize); wallpaperText = new Sprite(new Rectangle(0, 0, windowWidth, windowHeight), windowSize); nuages = new Sprite(new Rectangle(0, 0, windowWidth * 3, windowHeight), windowSize); nuages.Direction = new Vector2(-1, 0); nuages.Vitesse = 0.1f; // 1f = 1000 px/sec mouse = new AnimatedSprite(new Rectangle(-100, -100, 80, 100), windowSize, 8, 4, 40); relativeAmplitudeVibrationSelection = (float)amplitudeVibrationSelection / (float)(windowHeight + windowWidth); sprites = new List<AnimatedSprite>(); menuItems = new Dictionary<Selection, Sprite>(); menuItems.Add(Selection.Play, new Sprite(new Rectangle(112, 423, 124, 55), windowSize, "menu/textPlay")); menuItems.Add(Selection.Extra, new Sprite(new Rectangle(191, 480, 124, 55), windowSize, "menu/textExtra")); menuItems.Add(Selection.Options, new Sprite(new Rectangle(394, 470, 135, 55), windowSize, "menu/textOptions")); menuItems.Add(Selection.Credit, new Sprite(new Rectangle(562, 400, 124, 55), windowSize, "menu/textCredit")); menuItems.Add(Selection.Exit, new Sprite(new Rectangle(675, 480, 101, 55), windowSize, "menu/textExit")); Fire = new ParticleEngine(new Rectangle(0,windowSize.Height,windowSize.Width,0)); Fire.SetSpeedRange(0.2f, 2f, 90, 40); Fire.SetLifeTimeRange(20, 90); Fire.SetScaleRange(0.2f, 1.4f); Cursor = new ParticleEngine(new Rectangle()); Cursor.SetSpeedRange(0.2f, 1.6f, -45, 25); Cursor.SetAngularSpeedRange(0, 3); Cursor.SetLifeTimeRange(20, 50); Cursor.SetScaleRange(0.2f, 1.4f); Cursor.SetColorRange(0, 255, 0, 255, 0, 255, 0, 20); }
public SceneOptions(Rectangle windowSize, KeyboardState keyboardState, MouseState mouseState) { _windowSize = windowSize; _keyboardState = keyboardState; _mouseState = mouseState; _wallpaper = new Sprite(new Rectangle(0, 0, _windowSize.Width, _windowSize.Height), _windowSize, "menu/wallpaper"); _mouse = new AnimatedSprite(new Rectangle(-100, -100, 80, 100), windowSize, "sprites/cursorFire_8x4r", 8, 4, 40); _soundMusic = new Sprite(new Rectangle(100, 423, 110, 55), _windowSize, "menu/soundMusic"); _soundEffect = new Sprite(new Rectangle(170, 480, 110, 55), _windowSize, "menu/soundEffect"); }
public AnimatedSprite(AnimatedSprite s = null) : base((Sprite)s) { Lignes = s.Lignes; Colonnes = s.Colonnes; ActualPicture = s.ActualPicture; FirstPicture = s.FirstPicture; LastPicture = s.LastPicture; _repeating = s._repeating; _elapsedTime = s._elapsedTime; }
/// <summary> /// Constructeur /// </summary> /// <param name="windowSize">Taille courante de la fenetre</param> /// <param name="mainContainer">Fond du menu</param> /// <param name="backOpacity">Opacite de l'arriere-plan du menu (entre 0 et 255)</param> public ContextMenu(Rectangle windowSize, AnimatedSprite mainContainer, String exitButtonSpriteName = "", byte backOpacity = 255) { _windowSize = windowSize; _container = mainContainer; _elements = new List<AnimatedSprite>(); _backOpacity = backOpacity; if (exitButtonSpriteName != "") _exit = new AnimatedSprite( new Rectangle(Position.X + Position.Width - Position.Width / 10, Position.Y, Position.Width / 10, Position.Width / 10), _windowSize, exitButtonSpriteName); }
public Attack(Rectangle winSize, AnimatedSprite sprite, int duration = 50, float damage = 0.2f, int blockTime = 300, int attackTime = 50,float consumption=0.1f) { _sprite = sprite; Active = false; _lifetime = 0; Duration = duration; Damage = damage; BlockTime = blockTime; AttackTime = attackTime; Consumption = consumption; }
public HUD(Rectangle windowsize) { //"game/HUD", "game/life_mob", "game/mana", "game/xp", "SpriteFont1" LifeLevel = 0; _background = new Sprite(new Rectangle(0, 0, windowsize.Width, windowsize.Height / 5), windowsize, "game/HUD"); _life = new AnimatedSprite(new Rectangle(278, 20, 300, 10), windowsize, "game/life_mob"); _mana = new AnimatedSprite(new Rectangle(278, 50, 300, 10), windowsize, "game/mana"); _xp = new AnimatedSprite(new Rectangle(278, 80, 300, 10), windowsize, "game/xp"); _levelText = new TextSprite("SpriteFont1", windowsize, new Rectangle(600, 20, 50, 20), "Level", Color.Gold); _level = new TextSprite("SpriteFont1", windowsize, new Rectangle(600, 40, 50, 70), "1", Color.Gold); _ennemiesLeftText = new TextSprite("SpriteFont1", windowsize, new Rectangle(700, 20, 60, 20), "Ennemies", Color.DarkRed); _ennemiesLeft = new TextSprite("SpriteFont1", windowsize, new Rectangle(700, 40, 60, 70), "--", Color.DarkRed); _portrait = new AnimatedSprite(new Rectangle(10, 10, 175, 90), windowsize, "game/persoPortrait"); }
public Character(AnimatedSprite s, Vector3 stopR = new Vector3(), Vector3 stopL = new Vector3(), Vector3 runR = new Vector3(), Vector3 runL = new Vector3(), Vector3 jumpR = new Vector3(), Vector3 jumpL = new Vector3()) { _character = s; action = new Vector3[NB_ELEMENTS_IN_ENUM_ACTION]; action[(int)Action.StopR] = stopR; action[(int)Action.StopL] = stopL; action[(int)Action.RunR] = runR; action[(int)Action.RunL] = runL; action[(int)Action.JumpR] = jumpR; action[(int)Action.JumpL] = jumpL; _state = State.StopR; Life = 100; }
public Character(Rectangle winSize, Vector2 position, int width, int height, string assetName, int textureColumns, int textureLines) { _windowSize = winSize; _position = position; _graphicalBounds = new GraphicalBounds<CharacterActions>(new Dictionary<CharacterActions, Rectangle>()); _sprite = new AnimatedSprite(new Rectangle((int)position.X - width / 2, (int)position.Y - height, width, height), winSize, assetName, textureColumns, textureLines, 30, 1, -1, -1, true); _canMove = true; _jumping = false; _jumpHeight = 0; _direction = true; // = right _timer = 0; _physics = new Physics(); Life = 1; _action = CharacterActions.StandRight; _attacks = new Dictionary<CharacterActions, Attack>(); }
public SceneOptions(Rectangle windowSize, KeyboardState keyboardState, MouseState mouseState) { _windowSize = windowSize; _keyboardState = keyboardState; _mouseState = mouseState; _wallpaper = new Sprite(new Rectangle(0, 0, _windowSize.Width, _windowSize.Height), _windowSize, "menu/wallpaper"); _mouse = new AnimatedSprite(new Rectangle(-100, -100, 80, 100), windowSize, "sprites/cursorFire_8x4r", 8, 4, 40); _textMusic = new Sprite(new Rectangle(70, 433, 110, 40), _windowSize, "menu/soundMusic"); _textEffects = new Sprite(new Rectangle(150, 490, 110, 40), _windowSize, "menu/soundEffect"); _soundMusic = new Sprite(new Rectangle(180, 423, 110, 55), _windowSize, "menu/soundBars"); _soundEffect = new Sprite(new Rectangle(260, 480, 110, 55), _windowSize, "menu/soundBars"); _checkUpdate = new TextSprite("SpriteFont1", _windowSize, new Rectangle(530, 450, 170, 50), Color.Goldenrod, INFO.ENG?"Check Updates":"Mise a jour"); _serverConfig = new TextSprite("SpriteFont1", _windowSize, new Rectangle(560, 500, 200, 50), Color.Goldenrod, INFO.ENG?"Server Settings":"Options du serveur"); _fullScreen = new TextSprite("SpriteFont1", _windowSize, new Rectangle(500, 400, 150, 50), Color.Goldenrod, INFO.ENG ? "Fullscreen" : "Plein ecran"); _language = new TextSprite("SpriteFont1", _windowSize, new Rectangle(590,550,210,80),Color.Goldenrod, INFO.ENG?"Language : English":"Langage : Francais"); _version = new TextSprite("SpriteFont1", _windowSize, new Rectangle(15, _windowSize.Height - 30, 100, 30), Color.Goldenrod, "Version : " + INFO.version); }
public HUD(Rectangle windowsize) { this.LifeLevel = 0.0f; this._weapons = new List<Tip>(); this._background = new Sprite(new Rectangle(0, 0, windowsize.Width, windowsize.Height / 5), windowsize, "game/HUD"); this._life = new AnimatedSprite(new Rectangle(278, 20, 300, 10), windowsize, "game/life_mob", 1, 1, 30, 1, -1, -1, false); this._mana = new AnimatedSprite(new Rectangle(278, 50, 300, 10), windowsize, "game/mana", 1, 1, 30, 1, -1, -1, false); this._xp = new AnimatedSprite(new Rectangle(278, 80, 300, 10), windowsize, "game/xp", 1, 1, 30, 1, -1, -1, false); this._level = new TextSprite("SpriteFont1", windowsize, new Rectangle(600, 40, 50, 70), Color.Gold, "1"); this._ennemiesLeft = new TextSprite("SpriteFont1", windowsize, new Rectangle(700, 40, 60, 70), Color.DarkRed, "--"); this._portrait = new AnimatedSprite(new Rectangle(10, 10, 175, 90), windowsize, "game/persoPortrait", 1, 1, 30, 1, -1, -1, false); this._sprites = new List<Sprite>(); this._sprites.Add((Sprite)new TextSprite("SpriteFont1", windowsize, new Rectangle(600, 20, 50, 20), Color.Gold, INFO.ENG?"Level":"Niveau")); this._sprites.Add((Sprite)new TextSprite("SpriteFont1", windowsize, new Rectangle(700, 20, 60, 20), Color.DarkRed, INFO.ENG ? "Enemies" : "Ennemis")); this._sprites.Add((Sprite)new TextSprite("SpriteFont1", windowsize, new Rectangle(215, 15, 45, 20), Color.Red, INFO.ENG ? "Life" : "Vie")); this._sprites.Add((Sprite)new TextSprite("SpriteFont1", windowsize, new Rectangle(215, 45, 45, 20), Color.CornflowerBlue, INFO.ENG ? "Mana" : "Mana")); this._sprites.Add((Sprite)new TextSprite("SpriteFont1", windowsize, new Rectangle(215, 75, 45, 20), Color.Gold, INFO.ENG ? "Exp": "Exp")); }
public Personnage(Rectangle winsize, Vector2 position) : base(winsize, position, 140, 190, "game\\perso", 15, 4) { this._graphicalBounds = new GraphicalBounds<CharacterActions>(new Dictionary<CharacterActions, Rectangle>()); this._graphicalBounds.set(CharacterActions.WalkRight, 3, 6, 15, 30); this._graphicalBounds.set(CharacterActions.WalkLeft, 18, 21, 30, 30); this._graphicalBounds.set(CharacterActions.StandRight, 1, 1, 2, 4); this._graphicalBounds.set(CharacterActions.StandLeft, 16, 16, 17, 4); this._graphicalBounds.set(CharacterActions.JumpRight, 31, 31, 35, 30); this._graphicalBounds.set(CharacterActions.JumpLeft, 36, 36, 40, 30); this._graphicalBounds.set(CharacterActions.Attack1Right, 41, 41, 49, 50); this._graphicalBounds.set(CharacterActions.Attack1Left, 50, 50, 58, 50); this._graphicalBounds.set(CharacterActions.AttackStunRight, 1, 1, 2, 4); this._graphicalBounds.set(CharacterActions.AttackStunLeft, 16, 16, 17, 4); this._graphicalBounds.set(CharacterActions.ReceiveAttackRight, 60, 60, 60, 30); this._graphicalBounds.set(CharacterActions.ReceiveAttackLeft, 59, 59, 59, 30); this._graphicalBounds.set(CharacterActions.Attack2Right, 1, 1, 2, 5); this._graphicalBounds.set(CharacterActions.Attack2Left, 16, 16, 17, 5); this.Action = CharacterActions.StandRight; this._physics.MaxHeight = 400; this._physics.TimeOnFlat = 500; this._inputManager = new InputManager<Personnage.KeysActions, Keys>(); this._weapons.Add(new Weapon(winsize, "game/weapon", this.Sprite.Lignes, this.Sprite.Colonnes, this.Sprite.Position.Width, this.Sprite.Position.Height, 1f)); Enumerable.Last<Weapon>((IEnumerable<Weapon>)this._weapons).Tip = new Tip(this._windowSize, new Rectangle(this._windowSize.Width - 60, this._windowSize.Height - 60, 40, 40), "game/tips/sword2_tip", "SpriteFont1", "x" + this.Weapons[0].Damage.ToString() + " ", Color.Gold); this._weapons.Add(new Weapon(winsize, "game/weapon2", this.Sprite.Lignes, this.Sprite.Colonnes, this.Sprite.Position.Width, this.Sprite.Position.Height, 1.5f)); Enumerable.Last<Weapon>((IEnumerable<Weapon>)this._weapons).Tip = new Tip(this._windowSize, new Rectangle(this._windowSize.Width - 110, this._windowSize.Height - 60, 40, 40), "game/tips/sword3_tip", "SpriteFont1", "x" + this.Weapons[1].Damage.ToString() + " ", Color.Gold); this.Weapon = 0; this.InitKeys(); this.actualizeSpriteGraphicalBounds(); this.actualizeSpritePosition(); this.Jump(); this.Mana = 1f; this._experience = new ExperienceCounter(ExperienceCounter.Growth.Cuadratic, 200); this.AddAttack(CharacterActions.AttackStunLeft, new Attack(this._windowSize, new AnimatedSprite(new Rectangle(0, 0, 400, 400), this._windowSize, "sprites/expl_spread_6x6", 6, 6, 30, 1, 32, 1, true), 1500, 1.0f / 1000.0f, 3000, 400, 0.3f)); this.AddAttack(CharacterActions.AttackStunRight, new Attack(this._windowSize, new AnimatedSprite(new Rectangle(0, 0, 400, 400), this._windowSize, "sprites/expl_spread_6x6", 6, 6, 30, 1, 32, 1, true), 1500, 1.0f / 1000.0f, 3000, 400, 0.3f)); this.AddAttack(CharacterActions.Attack1Right, new Attack(this._windowSize, new AnimatedSprite(new Rectangle(0, 0, 10, 10), this._windowSize, "general/vide", 1, 1, 30, 1, -1, -1, false), 50, 0.1f, 280, 300, 0.05f)); this.AddAttack(CharacterActions.Attack1Left, new Attack(this._windowSize, new AnimatedSprite(new Rectangle(0, 0, 10, 10), this._windowSize, "general/vide", 1, 1, 30, 1, -1, -1, false), 50, 0.1f, 280, 300, 0.05f)); AnimatedSprite a = new AnimatedSprite(new Rectangle(0, 0, 100, 100), this._windowSize, "sprites/distant_attack_5x7", 5, 7, 30, 1, 35, 1, false); a.Direction = new Vector2(-2, 1); a.Vitesse = 0.15f; this.AddAttack(CharacterActions.Attack2Left, new Attack(this._windowSize, a, 2000, 0.05f, 1000, 1000, 0.5f)); a = new AnimatedSprite(new Rectangle(0, 0, 100, 100), this._windowSize, "sprites/distant_attack_5x7", 5, 7, 30, 1, 35, 1, false); a.Direction = new Vector2(2, 1); a.Vitesse = 0.15f; this.AddAttack(CharacterActions.Attack2Right, new Attack(this._windowSize, a, 2000, 0.05f, 1000, 1000, 0.5f)); }
public SceneExtras(Rectangle windowSize, KeyboardState keyboardState, MouseState mouseState) { _windowSize = windowSize; _mouseState = mouseState; _keyboardState = keyboardState; selectedSprite = 0; currentSize = 150; tailleSelection = new Sprite(new Rectangle(0, 400, windowSize.Width, 85), windowSize); mouse = new AnimatedSprite(new Rectangle(-100, -100, 60, 80), _windowSize, 8, 4, 30); animations = new List<AnimatedSprite>(); textures = new List<AnimatedSprite>(); textures.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/canalisation1_16x13", 16, 13)); textures.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion0_8x6", 8, 6)); textures.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion1_8x6", 8, 6)); textures.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion2_8x8", 8, 8)); textures.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion3_8x4", 8, 4)); textures.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion4_8x8", 8, 8)); textures.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/fireWall_11x6r23r44", 11, 6)); textures.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/popGreen_8x4", 8, 4)); textures.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/spriteElectric_11x3r12r23", 11, 3)); int c = textures.Count; int wi = windowSize.Width / c; for (int i = 0; i < c; i++) { textures.ElementAt<AnimatedSprite>(i).setRelatvePos( new Rectangle(i * wi, 485, wi, windowSize.Height - 485), windowSize.Width, windowSize.Height); } //particle test Snow = new ParticleEngine(new Rectangle(0,0,windowSize.Width,0)); Snow.SetSpeedRange(1.2f, 1.8f,-90, 40); Snow.SetAngularSpeedRange(0, 3); Snow.SetLifeTimeRange(20, 800); Snow.SetScaleRange(0.3f, 1.4f); Snow.SetColorRange(255, 255, 255, 255, 255, 255, 20, 30); Fire = new ParticleEngine(new Rectangle()); Fire.SetSpeedRange(0.3f, 1.4f, 90, 180); Fire.SetLifeTimeRange(20, 100); Fire.SetScaleRange(0.2f, 1.4f); //fin test }
public Character(Rectangle winSize, Vector2 position, int width, int height, string assetName, int textureColumns, int textureLines) { this._windowSize = winSize; this._position = position; Damage = 1; this._weapons = new List<Weapon>(); this._graphicalBounds = new GraphicalBounds<CharacterActions>(new Dictionary<CharacterActions, Rectangle>()); this._sprite = new AnimatedSprite(new Rectangle((int)position.X - width / 2, (int)position.Y - height, width, height), winSize, assetName, textureColumns, textureLines, 30, 1, -1, -1, true); this._canMove = true; this._jumping = false; this._jumpHeight = 0; this._direction = true; this._timer = 0; this._physics = new Physics(200, 1000); this.Life = 1f; this._action = CharacterActions.StandRight; this._attacks = new Dictionary<CharacterActions, Attack>(); Armor = 1; CanBeStunned = true; }
public MainMenu(Rectangle windowSize, KeyboardState newKeyboardState, MouseState newMouseState) { windowWidth = windowSize.Width; windowHeight = windowSize.Height; keyboardState = newKeyboardState; mousestate = newMouseState; selection = Selection.Play; wallpaper = new Sprite(new Rectangle(0, 0, windowWidth, windowHeight), windowSize); wallpaperText = new Sprite(new Rectangle(0, 0, windowWidth, windowHeight), windowSize); nuages = new Sprite(new Rectangle(0, 0, windowWidth * 3, windowHeight), windowSize); nuages.Direction = new Vector2(-1, 0); nuages.Vitesse = 0.1f; // 1f = 1000 px/sec mouse = new AnimatedSprite(new Rectangle(-100, -100, 80, 100), windowSize, 8, 4, 40); relativeAmplitudeVibrationSelection = (float)amplitudeVibrationSelection / (float)(windowHeight + windowWidth); sprites = new List<AnimatedSprite>(); menuItems = new Dictionary<Selection, Sprite>(); menuItems.Add(Selection.Play, new Sprite(new Rectangle(112, 423, 124, 55), windowSize, "menu/textPlay")); menuItems.Add(Selection.Extra, new Sprite(new Rectangle(191, 480, 124, 55), windowSize, "menu/textExtra")); menuItems.Add(Selection.Options, new Sprite(new Rectangle(394, 470, 135, 55), windowSize, "menu/textOptions")); menuItems.Add(Selection.Credit, new Sprite(new Rectangle(562, 400, 124, 55), windowSize, "menu/textCredit")); menuItems.Add(Selection.Exit, new Sprite(new Rectangle(675, 480, 101, 55), windowSize, "menu/textExit")); }
public Element(AnimatedSprite _s, float _speed = 0, float _verticalSpeed = 0, bool _repeating = false, bool _foreground = false, bool isportal = false, bool isportalnext = true) { sprite = _s; speed = _speed; verticalSpeed = _verticalSpeed; repeating = _repeating; foreground = _foreground; originalPosition = _s.Position; isPortal = isportal; isPortalNext = isportalnext; }
public Attac(AnimatedSprite s, int duree = 10) { _duree = duree; _sprite = s; }
public Weapon(Rectangle winsize, string assetName, int lignes, int colones, int width, int height, float damage = 1f) { this._sprite = new AnimatedSprite(new Rectangle(0, 0, width, height), winsize, assetName, colones, lignes, 30, 1, -1, -1, false); this.Damage = damage; }
/// <summary> /// Ajout d'un element de menu, l'origine des positions est la position du container principal (fond). /// </summary> /// <param name="s">Element de menu a ajouter</param> public void Add(AnimatedSprite s) { s.Position = new Rectangle(s.Position.X + Position.X, s.Position.Y + Position.Y, s.Position.Width, s.Position.Height); s.setRelatvePos(s.Position, _windowSize.Width, _windowSize.Height); _elements.Add(s); }
public Element(AnimatedSprite _s, float _speed = 0, float _verticalSpeed = 0, bool _repeating = false, bool _foreground = false) { sprite = _s; speed = _speed; verticalSpeed = _verticalSpeed; repeating = _repeating; foreground = _foreground; }
/// <summary> /// Ajoute un element a la map. /// </summary> /// <param name="s">AnimatedSprite representant l'element</param> /// <param name="horizontalSpeed">Vitesse horizontale</param> /// <param name="verticalSpeed">Vitesse verticale</param> /// <param name="repeating">Si la valeur est true, l'element se repete. Attention, ne fonctionne pas avec des elements trop petits.</param> /// <param name="isForeground">Si la valeur est true, l'element sera dessine devant le personnage.</param> public virtual void Add(AnimatedSprite s, float horizontalSpeed = 0, float verticalSpeed = 0, bool repeating = false, bool isForeground = false) { _elements.Add(new Element(s, horizontalSpeed, verticalSpeed, repeating, isForeground)); }
public Element(AnimatedSprite _s, float _speed = 0.0f, float _verticalSpeed = 0.0f, bool _repeating = false, bool _foreground = false, bool isportal = false, bool isportalnext = true, bool healing = false) { this.sprite = _s; this.speed = _speed; this.verticalSpeed = _verticalSpeed; this.repeating = _repeating; this.foreground = _foreground; this.originalPosition = _s.Position; this.isPortal = isportal; this.isPortalNext = isportalnext; this.isHeal = healing; }
public virtual void Add(AnimatedSprite s, float horizontalSpeed = 0.0f, float verticalSpeed = 0.0f, bool repeating = false, bool isForeground = false) { this._elements.Add(new AbstractMap.Element(s, horizontalSpeed, verticalSpeed, repeating, isForeground, false, true, false)); }
public Weapon(Rectangle winsize, string assetName, int lignes, int colones, int width, int height) { _sprite = new AnimatedSprite(new Rectangle(0, 0, width, height), winsize, assetName, colones, lignes); }