Exemplo n.º 1
0
 public void DestroyItemDrop(ItemDropObj itemDrop)
 {
     if (m_itemDropPool.ActiveObjsList.Contains(itemDrop))
     {
         itemDrop.Visible      = false;
         itemDrop.TextureColor = Color.White;
         m_physicsManager.RemoveObject(itemDrop);
         m_itemDropPool.CheckIn(itemDrop);
     }
 }
Exemplo n.º 2
0
 public void DestroyProjectile(EnergonProjectileObj projectile)
 {
     if (m_projectilePool.ActiveObjsList.Contains(projectile))
     {
         projectile.Visible          = false;
         projectile.Scale            = new Vector2(1f, 1f);
         projectile.CollisionTypeTag = 3;
         PhysicsMngr.RemoveObject(projectile);
         m_projectilePool.CheckIn(projectile);
     }
 }
Exemplo n.º 3
0
 public void DestroyEffect(RogueAPI.Effects.EffectSpriteInstance obj)
 {
     obj.OutlineWidth = 0;
     obj.Visible      = false;
     obj.Rotation     = 0f;
     obj.TextureColor = Color.White;
     obj.Opacity      = 1f;
     m_resourcePool.CheckIn(obj);
     obj.Flip           = SpriteEffects.None;
     obj.Scale          = new Vector2(1f);
     obj.AnimationDelay = 0.0333333351f;
 }
Exemplo n.º 4
0
        public void DestroyIcon(ProjectileObj projectile)
        {
            var attachedIcon = projectile.AttachedIcon;

            attachedIcon.Visible      = false;
            attachedIcon.Rotation     = 0f;
            attachedIcon.TextureColor = Color.White;
            attachedIcon.Opacity      = 1f;
            attachedIcon.Flip         = SpriteEffects.None;
            attachedIcon.Scale        = new Vector2(1f, 1f);
            m_resourcePool.CheckIn(attachedIcon);
            attachedIcon.AttachedProjectile = null;
            projectile.AttachedIcon         = null;
        }
Exemplo n.º 5
0
        public void DisplayNumberStringText(int amount, string text, Color color, Vector2 position)
        {
            var textObj = m_resourcePool.CheckOut();

            textObj.Font     = Game.JunicodeFont;
            textObj.FontSize = 14f;
            textObj.Text     = amount + " " + text;
            var width = textObj.Width;

            m_resourcePool.CheckIn(textObj);
            var textObj2 = m_resourcePool.CheckOut();

            textObj2.Font         = Game.HerzogFont;
            textObj2.Text         = amount.ToString();
            textObj2.Align        = Types.TextAlign.Left;
            textObj2.FontSize     = 18f;
            textObj2.TextureColor = color;
            textObj2.Position     = new Vector2(position.X - width / 2f, position.Y - textObj2.Height / 2f);
            textObj2.Visible      = true;
            var textObj3 = m_resourcePool.CheckOut();

            textObj3.Font         = Game.JunicodeFont;
            textObj3.Text         = " " + text;
            textObj3.FontSize     = 14f;
            textObj3.Align        = Types.TextAlign.Left;
            textObj3.TextureColor = color;
            textObj3.Position     = textObj2.Position;
            textObj3.X           += textObj2.Width;
            textObj3.Y           -= 5f;
            textObj3.Visible      = true;
            Tween.By(textObj2, 0.3f, Quad.EaseOut, "Y", "-60");
            Tween.To(textObj2, 0.2f, Linear.EaseNone, "delay", "0.5", "Opacity", "0");
            Tween.AddEndHandlerToLastTween(this, "DestroyText", textObj2);
            Tween.By(textObj3, 0.3f, Quad.EaseOut, "Y", "-60");
            Tween.To(textObj3, 0.2f, Linear.EaseNone, "delay", "0.5", "Opacity", "0");
            Tween.AddEndHandlerToLastTween(this, "DestroyText", textObj3);
        }
Exemplo n.º 6
0
 public void DestroyProjectile(ProjectileObj projectile)
 {
     if (m_projectilePool.ActiveObjsList.Contains(projectile))
     {
         projectile.CollidesWithTerrain     = true;
         projectile.DestroyOnRoomTransition = true;
         projectile.ChaseTarget             = false;
         projectile.Target       = null;
         projectile.Visible      = false;
         projectile.Scale        = new Vector2(1f, 1f);
         projectile.CurrentSpeed = 0f;
         projectile.Opacity      = 1f;
         projectile.IsAlive      = false;
         projectile.IsCollidable = true;
         m_levelScreen.PhysicsManager.RemoveObject(projectile);
         m_projectilePool.CheckIn(projectile);
     }
 }