public void OnDraw(long frame, ITurtleDrawing drawing) { // when that happens, generate new location for square // Bonus: Add counter number times caught Color color = Colors.Red; //new Color ((byte)(random.Next () % 256), (byte)(random.Next () % 256), (byte)(random.Next () % 256)); drawing.Fill(color); drawing.DrawSquare(Colors.Green, SquarePosition, SquareSize); drawing.DrawText(Colors.White, new Point(16, 16), CaughtCount.ToString()); drawing.DrawTurtle(TurtlePosition); }
public void OnDraw(long frame, ITurtleDrawing drawing) { HandlePhysics(); drawing.Fill(Colors.Black); // Pool drawing.DrawSquare(Colors.Blue, new Point(200, 250), new Size(70, 25)); // Ground drawing.DrawSquare(new Color(139, 69, 19), new Point(0, 260), new Size(500, 25)); // Hero drawing.DrawTurtle(TurtlePosition); }
public void OnDraw(long frame, ITurtleDrawing drawing) { if (!IsInitialized) { PlayArea = new Size((int)drawing.ScreenWidth, (int)drawing.ScreenHeight); RightPaddleX = (int)(drawing.ScreenWidth - 40); LeftPaddleY = (int)((drawing.ScreenHeight * .5) - (PaddleHeight * .5)); RightPaddleY = LeftPaddleY; SetupBall(); IsInitialized = true; } drawing.Fill(Colors.Black); drawing.DrawSquare(new Color(255, 215, 0), new Point(0, 0), PlayArea); DrawPaddle(drawing); DrawBall(drawing); DrawScore(drawing); HandlePhysics(); HandleRules(); }