public Unicorn(UnicornData data) { _startTime = TimeSpan.FromSeconds(data.StartTime); _endTime = TimeSpan.FromSeconds(data.EndTime); _spawnTime = TimeSpan.FromSeconds(data.SpawnTime); _timer = _spawnTime; _standingEffect = new ParticleEffect(STAND_PARTICLE_EFFECT); _chargeEffect = new ParticleEffect(MOVE_PARTICLE_EFFECT); _explodeEffect = new ParticleEffect(EXPLODE_PARTICLE_EFFECT); _sprite = new Sprite(SPRITE_NAME, Sprite.SpriteType.Unit); _state = State.Dormant; _gravity = new Gravity(_position, UNICORN_GRAVITY); _hitRect = new Rectangle(0, 0, (int)_sprite.Width, (int)_sprite.Height); _spawnEnable = true; }
public Unicorn(UnicornData data) { _startTime = TimeSpan.FromSeconds(data.StartTime); _endTime = TimeSpan.FromSeconds(data.EndTime); _spawnTime = TimeSpan.FromSeconds(data.SpawnTime); _timer = _spawnTime; _standingEffect = new ParticleEffect(STAND_PARTICLE_EFFECT); _chargeEffect = new ParticleEffect(MOVE_PARTICLE_EFFECT); _explodeEffect = new ParticleEffect(EXPLODE_PARTICLE_EFFECT); _sprite = new Sprite(SPRITE_NAME); _state = State.Dormant; _gravity = new Gravity(_position, UNICORN_GRAVITY); _hitRect = new Rectangle(0, 0, (int)_sprite.Width, (int)_sprite.Height); _spawnEnable = true; }