Esempio n. 1
0
        public static DestroyableBase GetMoveableByEntityId(uint entityId)
        {
            DestroyableBase movable = null;

            _gameObjects.TryGetValue(entityId, out movable);
            return(movable);
        }
Esempio n. 2
0
        protected override void OnCollision(DestroyableBase hitEnt)
        {
            // Always remove projectile on collision.
            GamePool.FlagForPurge(ID);

            // Kill particle trail (bullet)
            if (WeaponBulletParticleEffect != null)
            {
                GetParticleEmitter(1).Kill();
            }
        }
Esempio n. 3
0
 public static void AddObjectToPool(DestroyableBase gameObject)
 {
     if (_updatingPool)
     {
         _deferredInsert.Add(gameObject);
     }
     else
     {
         _gameObjects.Add(gameObject.ID, gameObject);
     }
 }
Esempio n. 4
0
        protected override void OnCollision(DestroyableBase hitEnt)
        {
            // Handle player collision with lower tunnel by changing the player location.
            if (hitEnt is Tunnel)
            {
                // As the only colliding tunnel is a lower tunnel, always change player position.
                Vec3 playerPos = Position;
                Position = new Vec3(playerPos.x, playerPos.y, 75);
                return;
            }

            // Don't let player collide with own projectiles.
            if (hitEnt is DefaultAmmo && !(hitEnt as DefaultAmmo).IsHostile)
            {
                return;
            }

            ProcessHit(hitEnt is Door);
        }
Esempio n. 5
0
 protected virtual void OnCollision(DestroyableBase hitEnt)
 {
     // Collision event was not overridden, so we can unsubscribe.
     UnsubscribeFromCollision();
 }