Example #1
0
        public Bike(Level level, double x, double y)
        {
            this.level = level;
            this.physics = level.physics;

            Create(x, y);
            dead = false;
        }
Example #2
0
 public void AttachToLevel(Level level)
 {
     this.level = level;
     this.physics = level.physics;
     Reset();
 }
Example #3
0
        public void Prepare()
        {
            this.physics = InitializePhysics();
            this.world.Children.Clear();

            this.shell.SetVariable("world", this.world);
            this.shell.SetVariable("physics", this.physics);

            Stream s = this.GetType().Assembly.GetManifestResourceStream("SilverStunts.Level.py");
            string code = new StreamReader(s).ReadToEnd();
            shell.Execute(code);
        }
Example #4
0
        public Physics.Engine InitializePhysics()
        {
            Physics.Engine physics = new Physics.Engine();

            physics.SetDamping(0.99);
            physics.SetGravity(0.0, 0.5);
            physics.SetSurfaceBounce(0.0);
            physics.SetSurfaceFriction(0.2);

            return physics;
        }