Ejemplo n.º 1
0
		public Projectile(FightEngine fightengine, Character creator, ProjectileData data)
			: base(fightengine)
		{
			if (creator == null) throw new ArgumentNullException("creator");
			if (data == null) throw new ArgumentNullException("data");

			m_creator = creator;
			m_offsetcharacter = (data.PositionType == PositionType.P2) ? creator.GetOpponent() : creator;
			m_data = data;
			m_animationmanager = Creator.AnimationManager.Clone();
			m_spritemanager = Creator.SpriteManager.Clone();
			m_gameticks = 0;
			m_hitcountdown = 0;
			m_state = ProjectileState.Normal;
			m_totalhits = 0;
			m_hitpausecountdown = 0;
			m_currentpriority = Data.Priority;
			m_palfx = new PaletteFx();

			CurrentPalette = Creator.CurrentPalette;
			CurrentFacing = Creator.CurrentFacing;
			CurrentLocation = GetStartLocation();
			CurrentVelocity = Data.InitialVelocity;
			CurrentAcceleration = Data.Acceleration;
			CurrentFlip = SpriteEffects.None;
			CurrentScale = Data.Scale;
			DrawOrder = Data.SpritePriority;

			SetLocalAnimation(Data.AnimationNumber, 0);
		}
Ejemplo n.º 2
0
        public Projectile(FightEngine fightengine, Character creator, ProjectileData data)
            : base(fightengine)
        {
            if (creator == null)
            {
                throw new ArgumentNullException("creator");
            }
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            m_creator           = creator;
            m_offsetcharacter   = (data.PositionType == PositionType.P2) ? creator.GetOpponent() : creator;
            m_data              = data;
            m_animationmanager  = Creator.AnimationManager.Clone();
            m_spritemanager     = Creator.SpriteManager.Clone();
            m_gameticks         = 0;
            m_hitcountdown      = 0;
            m_state             = ProjectileState.Normal;
            m_totalhits         = 0;
            m_hitpausecountdown = 0;
            m_currentpriority   = Data.Priority;
            m_palfx             = new PaletteFx();

            CurrentPalette      = Creator.CurrentPalette;
            CurrentFacing       = Creator.CurrentFacing;
            CurrentLocation     = GetStartLocation();
            CurrentVelocity     = Data.InitialVelocity;
            CurrentAcceleration = Data.Acceleration;
            CurrentFlip         = SpriteEffects.None;
            CurrentScale        = Data.Scale;
            DrawOrder           = Data.SpritePriority;

            SetLocalAnimation(Data.AnimationNumber, 0);
        }