Exemplo n.º 1
0
        public Entity CreateSolidEntity(IRectangle hitBox)
        {
            var body = _physics.CreateBody(new BoxCollider(hitBox),
                                           new PhysicalMaterial
            {
                Absorption        = 0.8,
                Restoring         = 0.8,
                Viscosity         = 0.3,
                Density           = 2740,
                Friction          = 0.8,
                MovementEmitter   = true,
                MovementRecipient = false,
            });
            var entity = new Entity(this, body);

            Blocks.Add(entity);
            return(entity);
        }
Exemplo n.º 2
0
        internal virtual void OnCreate()
        {
            if (_isCreated)
            {
                return;
            }

            StateTracker.AddBlob(this);
            Body       = _physics.CreateBody(this, Radius, Mass, IsStatic);
            _isCreated = true;
        }