void DarkGDK() { //Lines to sketch vehicle dbLine(120, 400, 180, 400); dbLine(240, 400, 340, 400); dbLine(400, 400, 500, 400); dbLine(120, 400, 120, 200); dbLine(500, 400, 500, 300); dbLine(500, 300, 450, 200); dbLine(450, 200, 120, 200); //Circle to sketch wheels dbCircle(210, 410, 30); dbCircle(370, 410, 30); //Ice cream cone on top dbLine(290, 200, 305, 150); dbLine(290, 200, 275, 150); //Circle for ice cream dbCircle(290, 145, 16); //Text dbSetTextSize(50); dbText(200, 270, "Ice Cream"); //Wait for user to press key dbWaitKey(); }
void drawSquare(int centerX, int centerY) { //Square variables int x1 = centerX - WIDTH / 2; int y1 = centerY - HEIGHT / 2; int x2 = centerX + WIDTH / 2; int y2 = centerY + HEIGHT / 2; //Draw square dbLine(x1, y1, x2, y1); dbLine(x2, y1, x2, y2); dbLine(x2, y2, x1, y2); dbLine(x1, y2, x1, y1); }
void DarkGDK() { //Set variables int X; int Y; //Window title dbSetWindowTitle("Treasure Map"); //Set key color dbSetImageColorKey(0, 255, 0); //Load image dbLoadImage("treasure map.bmp", 1); //Display image dbPasteImage(1, 0, 0); //Enter X coordinate dbPrint("Please enter the X coordinate for treasure!"); X = atoi( dbInput() ); //Enter Y coordinate dbPrint("Please enter the Y coordinate for treasure!"); Y = atoi( dbInput() ); DWORD red = dbRGB(255, 0, 0); DWORD black = dbRGB(0, 0, 0); dbInk(red, black); //Draw the X dbLine(X-10, Y-10, X+10, Y+10); dbLine(X-10, Y+10, X+10, Y-10); //Wait for user to press a key dbWaitKey(); }
void drawScanlines(int linesBetween ) { int screenHeight = dbScreenHeight(); int screenWidth = dbScreenWidth(); dbInk( RGB(0,0,0), RGB(0,0,0) ); int currentLine = 0; while( currentLine < screenHeight ) { currentLine += linesBetween; dbLine( 0, currentLine, screenWidth, currentLine ); } }
void drawOctagon(int x, int y) { //Set variables int left = x - HALF; int top = y - HALF; int right = x + HALF; int bottom = y + HALF; //Draw Octagon line segments clockwise from the top dbLine(left + QUARTER, top, right - QUARTER, top); dbLine(right - QUARTER, top, right, y - QUARTER); dbLine(right, y - QUARTER, right, y + QUARTER); dbLine(right, y + QUARTER, right - QUARTER, bottom); dbLine(right - QUARTER, bottom, left + QUARTER, bottom); dbLine(left + QUARTER, bottom, left, y + QUARTER); dbLine(left, y + QUARTER, left, y - QUARTER); dbLine(left, y - QUARTER,left + QUARTER, top); }
void DarkGDK() { //Lines to sketch house dbLine(200, 250, 200, 450); dbLine(200, 450, 450, 450); dbLine(450, 450, 450, 250); dbLine(450, 250, 200, 250); //Roof dbLine(200, 250, 325, 100); dbLine(325, 100, 450, 250); //Lines to sketch door dbLine(240, 450, 240, 365); dbLine(240, 365, 300, 365); dbLine(300, 365, 300, 450); dbLine(300, 450, 240, 450); //Circle for door knob dbCircle(290, 408, 3); //Lines to sketch window 1 dbLine(250, 275, 250, 325); dbLine(250, 325, 290, 325); dbLine(290, 325, 290, 275); dbLine(290, 275, 250, 275); //Lines to sketch window 2 dbLine(370, 275, 370, 325); dbLine(370, 325, 410, 325); dbLine(410, 325, 410, 275); dbLine(410, 275, 370, 275); //Lines to sketch window 3 dbLine(350, 425, 420, 425); dbLine(420, 425, 420, 380); dbLine(420, 380, 350, 380); dbLine(350, 380, 350, 425); //Middle line dbLine(385, 425, 385, 380); //Wait for user to press key dbWaitKey(); }
void DrawTarget(Vector2D target) { int targetSize = 20; dbInk( RGB(0,0,255), RGB(0,0,255) ); dbLine(target.x-20, target.y, target.x+20, target.y); dbLine(target.x, target.y-targetSize, target.x, target.y+20 ); }