Beispiel #1
0
        public void Draw()
        {
            BeginDrawing();

            ClearBackground(Color.WHITE);
            DrawText(fps.ToString(), 10, 10, 12, Color.RED);

            tankObject.Draw();
            tankHitboxPoint1.Draw();
            tankHitboxPoint2.Draw();
            tankHitboxPoint3.Draw();
            tankHitboxPoint1.Draw();
            EndDrawing();
        }
Beispiel #2
0
        //Draw the framerate text and display the tank and turrent
        public void Draw()
        {
            rl.BeginDrawing();

            rl.ClearBackground(Color.WHITE);
            rl.DrawText(fps.ToString(), 10, 10, 12, Color.DARKBLUE);

            tankObject.Draw();

            rl.EndDrawing();
        }
Beispiel #3
0
 public void Draw()
 {
     BeginDrawing();               //Begins the creation of sprites
     ClearBackground(Color.BROWN); //Colors the Background to a specified setting
     for (int i = 0; i < bulletSprites.Count; i++)
     {
         bulletSprites[i].Draw();
     }
     boxObject.Draw();
     tankObject.Draw();                               //Creates and displays anything inside of "tankObject"
     DrawText(fps.ToString(), 10, 10, 12, Color.RED); //Creates visible text
     EndDrawing();                                    //Ends the creation of sprites
 }
Beispiel #4
0
        public void Draw()
        {
            BeginDrawing();
            ClearBackground(Color.WHITE);
            DrawText(fps.ToString(), 10, 10, 12, Color.RED);
            tankObject1.Draw();
            tankObject2.Draw();
            tankBulletObject1.Draw();
            tankBullet1.Draw(tankBullet1.blankHitBox.Overlaps(tank2.blankHitBox));
            tank1.Draw(tank1.blankHitBox.Overlaps(tank2.blankHitBox));
            tank2.Draw(tank2.blankHitBox.Overlaps(tank1.blankHitBox));

            EndDrawing();
        }
Beispiel #5
0
        /// <summary>
        /// This draws all the objects
        /// </summary>
        public void Draw()
        {
            BeginDrawing();

            ClearBackground(Color.WHITE);
            DrawText(fps.ToString(), 10, 10, 20, Color.RED);

            //This draws the tank.
            tankObject.Draw();

            //This draws a box around the tank to show where the corners of the tank are.
            DrawLine((int)tankHitBoxPoint[0].GlobalTransform.m7, (int)tankHitBoxPoint[0].GlobalTransform.m8, (int)tankHitBoxPoint[1].GlobalTransform.m7, (int)tankHitBoxPoint[1].GlobalTransform.m8, Color.PURPLE);
            DrawLine((int)tankHitBoxPoint[1].GlobalTransform.m7, (int)tankHitBoxPoint[1].GlobalTransform.m8, (int)tankHitBoxPoint[2].GlobalTransform.m7, (int)tankHitBoxPoint[2].GlobalTransform.m8, Color.PURPLE);
            DrawLine((int)tankHitBoxPoint[2].GlobalTransform.m7, (int)tankHitBoxPoint[2].GlobalTransform.m8, (int)tankHitBoxPoint[3].GlobalTransform.m7, (int)tankHitBoxPoint[3].GlobalTransform.m8, Color.PURPLE);
            DrawLine((int)tankHitBoxPoint[3].GlobalTransform.m7, (int)tankHitBoxPoint[3].GlobalTransform.m8, (int)tankHitBoxPoint[0].GlobalTransform.m7, (int)tankHitBoxPoint[0].GlobalTransform.m8, Color.PURPLE);

            //This converts the tankHitBoxPoint SceneObjects to Vector2's so they can be used in the Fit function.
            List <Vector2> points = new List <Vector2>()
            {
                new Vector2(tankHitBoxPoint[0].GlobalTransform.m7, tankHitBoxPoint[0].GlobalTransform.m8),
                new Vector2(tankHitBoxPoint[1].GlobalTransform.m7, tankHitBoxPoint[1].GlobalTransform.m8),
                new Vector2(tankHitBoxPoint[2].GlobalTransform.m7, tankHitBoxPoint[2].GlobalTransform.m8),
                new Vector2(tankHitBoxPoint[3].GlobalTransform.m7, tankHitBoxPoint[3].GlobalTransform.m8)
            };

            //This Fits the bounding box around the given points.
            tankObject.BoundingBox(points);
            //And this draws the bounding box.
            DrawLine((int)tankObject.boundingBox.min.x, (int)tankObject.boundingBox.min.y, (int)tankObject.boundingBox.max.x, (int)tankObject.boundingBox.min.y, tankBoxColor);
            DrawLine((int)tankObject.boundingBox.max.x, (int)tankObject.boundingBox.min.y, (int)tankObject.boundingBox.max.x, (int)tankObject.boundingBox.max.y, tankBoxColor);
            DrawLine((int)tankObject.boundingBox.max.x, (int)tankObject.boundingBox.max.y, (int)tankObject.boundingBox.min.x, (int)tankObject.boundingBox.max.y, tankBoxColor);
            DrawLine((int)tankObject.boundingBox.min.x, (int)tankObject.boundingBox.max.y, (int)tankObject.boundingBox.min.x, (int)tankObject.boundingBox.min.y, tankBoxColor);

            //This draws the wall.
            DrawRectangle((int)wall[0].x, (int)wall[0].y, (int)(wall[1].x - wall[0].x), (int)(wall[1].y - wall[0].y), Color.BROWN);
            //This draws the AABB around the wall.
            DrawRectangleLines((int)wall[0].x, (int)wall[0].y, (int)(wall[1].x - wall[0].x), (int)(wall[1].y - wall[0].y), wallBoxColor);

            EndDrawing();
        }
Beispiel #6
0
 public void Draw()
 {
     tankObject.Draw();
 }