Exemplo n.º 1
0
        public ParticlePlumeEffect(ActiveObject bindToObject, TimeSpan duration, PlumeType type)
        {
            Type = type;
              LastTick = Game1.CurrentTime;
              Duration = duration;
              BindToObject = bindToObject;

              AddParticles(MAX_PARTICLES);
        }
Exemplo n.º 2
0
        public TeleportEffect(ActiveObject bindToObject, TimeSpan duration, Events callbackEvent, object parameter)
        {
            LastTick = Game1.CurrentTime;
              Duration = duration;
              CallbackEvent = callbackEvent;
              Parameter = parameter;

              BindToObject = bindToObject;

              float startX = BindToObject.DrawBox.Left;
              float startY = BindToObject.DrawBox.Bottom;
              StartPosition = new Vector2(startX, startY);

              AddParticles(MAX_PARTICLES);
        }
Exemplo n.º 3
0
        public bool ShootAtObject(ActiveObject obj)
        {
            if (!obj.CanBeShot)
            return false;

              // Check distance
              float distance = obj.DrawBox.Center.Distance(DrawBox.Center);

              if (distance < ShootRange)
              {
            if (State == PlayerStates.Walking)
              Stop();

            if (State == PlayerStates.Standing || State == PlayerStates.Shooting)
            {
              ShootTarget = obj;
              State = PlayerStates.Shooting;
              Game1.EventMan.Notify(Events.PlayerShootsObj, new ActiveObject[] { this, obj });
              return true;
            }
              }

              return false;
        }
Exemplo n.º 4
0
 public void PlayerPickedUpByIcydactyl(object icydactylObj)
 {
     AttachedTo = (ActiveObject)icydactylObj;
       State = PlayerStates.Carried;
 }
Exemplo n.º 5
0
        public virtual bool WillCollide(ActiveObject obj)
        {
            float distance = GetDistance(obj) - (obj.Velocity.X * LastTimeDelta);

              return distance < (Hitbox.Width + obj.Hitbox.Width) / 2;
        }
Exemplo n.º 6
0
 public virtual bool IsCollide(ActiveObject obj)
 {
     return GetDistance(obj) < (Hitbox.Width + obj.Hitbox.Width) / 2;
 }
Exemplo n.º 7
0
 public virtual float GetOverlap(ActiveObject obj)
 {
     return GetDistance(obj) - obj.Hitbox.Width / 2;
 }
Exemplo n.º 8
0
 public virtual float GetDistance(ActiveObject obj)
 {
     return Vector2.Distance(Center, obj.Center);
       //return Hitbox.Center.Distance(obj.Hitbox.Center);
 }
Exemplo n.º 9
0
        public virtual float DistanceXCenter(ActiveObject obj)
        {
            float thisCenter = DrawBox.Center.X - DrawBox.Width / 2;
              float objCenter = obj.DrawBox.Center.X - obj.DrawBox.Width / 2;

              return Math.Abs(objCenter - thisCenter);
        }