DarkBASIC+Reference

DarkBASIC Reference

=Basic 2D Command Set= =Text:= || **print "text"** =Keyboard Input:= || **upkey** =Mouse:= || **mousex** =Loops:=
 * **cls** || **clears the screen using a specified background color** ||
 * **ink** || **sets the current foreground a background ink color** ||
 * **dot** || **puts a pixel on the screen in the current ink color** ||
 * **box x1,y1,x2,y2** || **draws a filled box on the screen in the current ink color** ||
 * **line x1,y1,x2,y2** || **draws a line on the screen using the current ink color** ||
 * **circle x, y, radius** || **draws a circle on the screen using the current ink color** ||
 * **ellipse x, y, x-radius, y-radius** || **draws an ellipse on the screen using the current ink color** ||
 * **point** || **returns the color of a pixel on the screen** ||
 * **RGB** || **generates color value using the red, green, and blue commands** ||
 * **print** || **generates output to the screen** ||
 * **sleep** || **pauses the program (sleep 1000 = 1 second)** ||
 * **input** || **takes numerical or string input from user** ||
 * **rnd(n)** || **generates a number between 0 and n, inclusive** ||
 * **prints text on the screen** ||
 * **print variable** || **prints a variable on the screen** ||
 * **set cursor x,y** || **positions the text at x and y values on the screen** ||
 * **up key on the keyboard** ||
 * **downkey** || **down key on the keyboard** ||
 * **leftkey** || **left key on the keyboard** ||
 * **rightkey** || **right key on the keyboard** ||
 * **spacekey** || **space bar on the keyboard** ||
 * **returnkey** || **return or enter key** ||
 * **controlkey** || **either of the control keys** ||
 * **shiftkey** || **either of the shift keys** ||
 * **inkey$** || **any other character key** ||
 * **gives the current x position of the mouse** ||
 * **mousey** || **gives the current y position of the mouse** ||
 * **mousez** || **refers to the wheel on the mouse** ||
 * **mouseclick** || **A value of 1 is the left button. A value of 2 is the right button. A value of 3 is both left and right buttons. A value of 0 is no buttons.** ||
 * **position mouse x, y** || **positions the mouse at x and y coordinates** ||
 * **for** || **for some condition with x**
 * `do stuff**
 * next x** || **r = 250**


 * for x = 1 to 20**
 * circle 320, 240, r**
 * r = r – 5**
 * wait 50**
 * next x** ||
 * **while…. endwhile** || **while some condition**
 * `do stuff**
 * endwhile** || **x = 1**
 * r = 100**


 * while x <= 20**
 * circle 320, 240, r**
 * r = r – 2**
 * x = x + 1**
 * endwhile** ||
 * **do** || **do**
 * `do stuff**
 * loop** || **x = 100**


 * do**
 * circle x, 240, 60**
 * x = x + 10**
 * wait 50**
 * loop** ||
 * **repeat… until** || **repeat**
 * `do stuff**
 * until some condition** || **y = 500**


 * repeat**
 * circle 100, y, 60**
 * y = y – 5**
 * until y < 100** ||