DB+Lab+1

DB Lab 1 - Basic 2D Command Set Due October 20, 2011 You can create graphics of your own using standard draw commands. You are able to draw dots, lines, boxes, circles, and ellipses in any color. You have the tools available to create your own painting package. Standard 2D command allow you to generate your graphics during the program, reducing the need to store Bitmaps and other visual media. These commands are explained in the HELP MENU of DarkBasic.
 * **cls** || **will clear the screen using a specified background color** ||
 * **ink** || **will set the current foreground a background ink color** ||
 * **dot** || **will put a pixel on the screen in the current ink color** ||
 * **box x1,y1,x2,y2** || **will draw a filled box on the screen in the current ink color** ||
 * **line x1,y1,x2,y2** || **will draw a line on the screen using the current ink color** ||
 * **circle x, y, radius** || **will draw a circle on the screen using the current ink color** ||
 * **ellipse x, y, x-radius, y-radius** || **will draw an ellipse on the screen using the current ink color** ||
 * **point** || **will return the color of a pixel on the screen** ||
 * **RGB** || **will generate color value using the red, green, and blue commands** ||
 * **print** || **will generate output to the screen** ||
 * **sleep** || **will pause the program (sleep 1000 = 1 second)** ||
 * **input** || **will take numerical or string input from user** ||

1) Create a folder in your P drive, and call it DB Lab1.flast. 2) Create a program that asks the user questions, including one with a numerical answer and one with a string answer, and displays something involving the answers given. Save the project as userInput. 3) Copy “Your First 2D Program” from page 10 – 11. Watch it for a while and relax. 4) Copy “Your First Game” from pages 11 – 14. Play it. 5) Write a program which will draw 15 concentric circles in different colors. Save the project as circles. 6) Write a program which will draw a set of 10 lines equal size from the point 200,100. Save the project as lines. 7) Write a program which will have the computer move a green rectangle across the screen from left to right. Save the project as rectangle. 8) Write a program which moves a circle around the screen based on user control of the arrow keys. Save the project as movingCircle.


 * Please read Chapter 1 in //DarkBasic Pro// by Wednesday, 10/19.