public Bike(Level level, double x, double y) { this.level = level; this.physics = level.physics; Create(x, y); dead = false; }
public void AttachToLevel(Level level) { this.level = level; this.physics = level.physics; Reset(); }
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); }
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; }