| public Ball(Vector2 position)␍␊ |
| {␍␊ |
| this.Position = position;␍␊ |
| ␍␊ |
| AllowAutomaticMouseJoint = true;␍␊ |
| }␍␊ |
| ␍␊ |
| public override void LoadContent(AxiosGameScreen gameScreen)␍␊ |
| {␍␊ |
| base.LoadContent(gameScreen);␍␊ |
| this.ConstantVelocity = new Vector2(7f, 7f);␍␊ |
| this.ConstantVelocity = new Vector2(7f, 0f);␍␊ |
| this.Texture = gameScreen.ScreenManager.Game.Content.Load<Texture2D>("ball");␍␊ |
| this.Origin = new Vector2(this.Texture.Width / 2, this.Texture.Height / 2);␍␊ |
| this.BodyPart = BodyFactory.CreateCircle(gameScreen.World, ConvertUnits.ToSimUnits(this.Texture.Width / 2), 1f);␍␊ |
|
| public void ResetBall()␍␊ |
| {␍␊ |
| this.ApplyConstantVelocity = false;␍␊ |
| ConstantVelocity = new Vector2(7f, 7f);␍␊ |
| ConstantVelocity = new Vector2(7f, 0f);␍␊ |
| this.BodyPart.Position = Vector2.Zero;␍␊ |
| this.BodyPart.LinearVelocity = Vector2.Zero;␍␊ |
| BodyPart.AngularVelocity = 0f;␍␊ |