Пример #1
0
        public void Init(String databaseName)
        {
            dataSetName = databaseName;

            //DataSet dataSet = JsonConvert.DeserializeObject<DataSet>(File.ReadAllText(@"Resources\Sprite.json"));
            String json = File.ReadAllText(databaseName);

            PhysicsReturn = JsonConvert.DeserializeObject <PhysicsSettings>(json);
        }
Пример #2
0
        public void InitPhysics(String jsonname)
        {
            PhysicsBuilder  p      = new PhysicsBuilder(jsonname);
            PhysicsSettings _tempP = p.PhysicsReturn;

            this.MovingSpeed       = _tempP.acceleration;
            this.maxSpeed          = _tempP.maxSpeed;
            this.body.Friction     = _tempP.friction;
            this.body.GravityScale = _tempP.mass;
            this.body.Restitution  = .1f;
            body.SleepingAllowed   = false;
            body.OnCollision      += new OnCollisionEventHandler(Body_OnCollision);
        }