//private int _id; #region Constructors public Player(float x, float y, float width, float height, float speed, double attackSpeed, int leftTexture, int rightTexture, ShotCharacteristics shotChar, int hp, int damage, float shotSpeed, float shotRange, string name) : base(x, y, width, height, speed, attackSpeed, leftTexture, rightTexture, shotChar, hp, damage, shotSpeed, shotRange, name) { }
public Person(float x, float y, float width, float height, float speed, double attackSpeed, int leftTexture, int rightTexture, ShotCharacteristics shotChar, int hp, int damage, float shotSpeed, float shotRange, string name) { _x = x; _y = y; _width = width; _height = height; _speed = speed; _leftTexture = leftTexture; _rightTexture = rightTexture; _currentTexture = leftTexture; _attackSpeed = attackSpeed; _canShoot = true; _isDead = false; _shotChar = shotChar; _hp = hp; _maxHp = hp; _damage = damage; _shotSpeed = shotSpeed; _shotRange = shotRange; _name = name; _xAttack = Form.Left; _yAttack = Form.Bottom - Form.Height / 2; }
public Enemy(float x, float y, string fileName) { _x = x; _y = y; var strings = File.ReadAllLines("Enemies/" + fileName); _width = float.Parse(strings[0]); _height = float.Parse(strings[1]); _speed = float.Parse(strings[2]); _attackSpeed = double.Parse(strings[3]); _leftTexture = int.Parse(strings[4]); _rightTexture = int.Parse(strings[5]); _currentTexture = _leftTexture; _shotChar = new ShotCharacteristics(strings[6] + ".f"); _maxHp = int.Parse(strings[7]); _hp = _maxHp; _damage = int.Parse(strings[8]); _shotSpeed = float.Parse(strings[9]); _shotRange = float.Parse(strings[10]); _name = strings[11]; _canShoot = true; _isDead = false; _isWaiting = true; _timer = new Timer(1000); _isWaiting = true; _timer.AutoReset = false; _timer.Elapsed += OnTimedEvent; }
public Boss(float x, float y, float width, float height, float speed, double attackSpeed, int leftTexture, int rightTexture, ShotCharacteristics shotChar, int hp, int damage, float shotSpeed, float shotRange, string name, BossAction skill) : base(x, y, width, height, speed, attackSpeed, leftTexture, rightTexture, shotChar, hp, damage, shotSpeed, shotRange, name) { _canUseSkill = true; _skill = skill; _isFinal = false; }
public void WriteInFile(string fileName, ShotCharacteristics shotChar) { using (var file = File.CreateText("Shots/" + fileName)) { file.WriteLine(shotChar.Width); file.WriteLine(shotChar.Height); file.WriteLine(shotChar.LeftTexture); file.WriteLine(shotChar.RightTexture); file.WriteLine(shotChar.Name); } }
public Enemy(float x, float y, float width, float height, float speed, double attackSpeed, int leftTexture, int rightTexture, ShotCharacteristics shotChar, int hp, int damage, float shotSpeed, float shotRange, string name) : base(x, y, width, height, speed, attackSpeed, leftTexture, rightTexture, shotChar, hp, damage, shotSpeed, shotRange, name) { _isWaiting = true; _timer = new Timer(1000); _isWaiting = true; _timer.AutoReset = false; _timer.Elapsed += OnTimedEvent; }
public Person(float x, float y, float width, float height, float speed, double attackSpeed, int texture, ShotCharacteristics shotChar, int hp) { _x = x; _y = y; _width = width; _height = height; _speed = speed; _texture = texture; _attackSpeed = attackSpeed; _canShoot = true; _isDead = false; _shotChar = shotChar; _hp = hp; }
public Enemy(float x, float y, float width, float height, float speed, double attackSpeed, int texture, ShotCharacteristics shotChar, int hp) : base(x, y, width, height, speed, attackSpeed, texture, shotChar, hp) { }