- #Where to get dark basic pro pro#
- #Where to get dark basic pro software#
- #Where to get dark basic pro code#
Save your project.įIG-2 Testing the Digits NOTE: You will probably have to modify the SET DISPLAY MODE line to match your own screens resolution.ĭarkBASIC Pro: Counters and Timers Copyright 2011 A.
#Where to get dark basic pro code#
Execute your code and check that all 10 digits are correctly displayed. Copy Digits.bmp into the projects folder.
#Where to get dark basic pro pro#
REM***Positionthesprite ***SPRITE1,640,480,1 //***Defaultstoframe0***REM***Displayeachframeinturn***FORcount=2TO10 WAIT500SETSPRITEFRAME1,countNEXTcountREM***Endprogram ***WAITKEYENDĪctivity 2 Start up DarkBASIC Pro and create a new project called Counter.dbpro. REM***Setuptheanimatedsprite***CREATEANIMATEDSPRITE1,Digits.bmp,10,1,1 The program in FIG-3 displays the values 00 to 99. We can determine the frame settings for any value of count using the formulae:įirstframe=count/10+1secondframe=countmod10+1 If count is, say, 37, then the first sprite needs to display frame 4 (which contains the digit 3) and the second sprite frame 8. When we are dealing with two sprites, we need to determine which frame each of these sprites needs to be set to for a given value of a variable called count. Counts up to 99 will need two sprites, 999, three sprites etc. If we want our count to go above 9, all we need to do is use two or more sprites. Positionthesprite FOR9timesdo Wait500milliseconds Displaythenextframe ENDFOR Endtheprogram If you do not have the resources to create the necessary file, this image and all others used in this article can be downloaded from our website (Go to the Downloads page in the DarkBASIC section. We need the background to be true black so that it will be transparent within the sprite. Save the file as Digits.bmp.Īlthough the background may look black, when the eye dropper is moved over the background we can see the the RGB settings are not 0,0,0 (true black). Trim any excess background above and below the digits. If necessary, resize the image so that its size in pixels is exactly divisible by 10.
Make sure the digits are evenly spaced and that the background colour is black.
#Where to get dark basic pro software#
These problems are easily solved by filling all background areas with true black (remembering also to fill the enclosed areas in the 0, 4, 6, 8, and 9).Īctivity 1 Use the software available to you to create an image containing the digits 0 to 9. In Adobe Photoshop, there are two problems with the image. The image is then loaded into a paintprogram. Since the graphic will be split into 10frames (one for each digit) we resizethe image so that its width is a multiple of 10.įinally, we trim the excess black areasabove and below the digits from theimage before resaving it. The program in FIG-2 demonstrates the use of the image. Frame 1 will contain the digit 0 frame 2 the digit 1 etc. To display the individual digits within our image we need to create a 10 framed animated sprite. If the Anti-Alias option is checked, the resulting image will not display clearly, showing rough pixelation around the edges of the digits.ĭarkBASIC Pro: Counters and Timers Copyright 2011 A. In the Rasterize Options dialog box, we need to select the options indicated below. The drawing is then exported as a bitmap (.bmp) file. The grid and its borders are then painted in black. The numbers are moved over the gridand stretched until there is one digit ineach cell. Picking a suitable font and size, wetype in the digits 0 to 9 with a single space between each digit. This ensures that digits are spaced equally. Working in Adobe Illustrator, we createa 10 column, 1 row grid. For our counter we need an image containing the digits 0 to 9. The simplest way to create a text display when working on a game is to create a graphic containing the required display. This article will take you through some of the ways of achieving this. However, when we want to see a running total or time on screen with real time updates then we need to work a little harder. Of course, counters and timers are fairly easy to achieve if they are never to be displayed or only to be displayed at the end of a game a simple variable and some type of display statement will achieve this. We need to count how many points youve accumulated during a game, the number of bullets remaining in your weapon, the number of health points your characters still has.Likewise, we need to know how much time is remaining to complete a task or how much time has been taken to achieve some objective. IntroductionMany games need to display either counters, or timers, or both. DarkBASIC Pro: Counters and Timers Copyright 2011 A.