protected override void UpdateWorld() { if (GamePad.ButtonBackClicked()) { Exit(); } // Ball mBall.UpdateSoccerPosition(GamePad.ThumbSticks.Left); // Block mBlock.UpdateBlock(GamePad.ThumbSticks.Right, GamePad.Triggers.Right); if (GamePad.Buttons.A == ButtonState.Pressed) { mShowVecA.Update(mBlock.Center, mBall.Center, mBlock.FrontDirection); } else { mShowVecA.HideVectorComponents(); } if (GamePad.Buttons.B == ButtonState.Pressed) { mShowVecB.Update(mBall.Center, mBlock.Center, mBlock.FrontDirection, mBlock.NormalDirection); } else { mShowVecB.HideVectorComponents(); } EchoToTopStatus("Block rotated angle=" + mBlock.RotateAngle); }
protected override void InitializeWorld() { World.SetWorldCoordinate(Vector2.Zero, kWorldSize); DefineGrid(); mBlock = new MyBlock(); mBall = new MySoccer(); mShowVecA = new VectorComponents(); mShowVecA.HideVectorComponents(); mShowVecB = new VectorComponents(); mShowVecB.HideVectorComponents(); }