Graphics Power Demonstration Program by Alex Shaw III, Techronology October 23, 2009 Personal Reference
The Idea
Create a program that demonstrates the graphical and animation features of Visual Basic for DOS
Main items to include in the program
Graphical title screen
Main menu in text mode
User will be able to revert back to menu
Introduce program
Graphics demonstration
Sample mini-programs
Display user-friendly interface
Allow user to control navigation
Program Summary
The Graphics Power demonstration program was designed in 1996 in Visual Basic for DOS
Do not let the year fool you; earlier programs provide the foundation of what we use today
Many of the elements in this program were created by hand and transformed to digital format using programming techniques, algorithms, and functions
The main part of this program contains at least 1,095 lines of code
Summary
A youngster
In 1996, I was somewhat a youngster; not even twenty-three
This program displays some of the skills I obtained at that time, ever since I started programming at thirteen
Programming
Ironically, some seasoned veterans I talk to today did not know there was a Visual Basic for DOS
I will provide some insight on how the techniques used in this program are applied to today's applications
Title Screen Believe it or not, all the elements on the title screen were created on graph paper first Using colored pencils, you can distinguish between the various transitions The graphics are transformed to screen with the DRAW command; a long process Although I cannot remember completely, the background boxes are loaded into memory first and the letters are an overlay... ...Or vice versa
Main Menu This menu was created in the menu builder in VB for DOS Well, it enabled you to utilize mouse functionality in DOS, which was difficult to program standalone Everything else had to be programmed, including the centering of boxes, which is a technique still used today Also, the border lines are part of the extended ASCII code
Introduction to this Program
Introduction—Page One It is always important to maintain a neat format The introduction is more like a data element; well, each line is a separate data element that I loaded with a looping structure We are still in text mode
Introduction—Page Two
Graphics Demonstration
Graphics Demonstration Menu Now we get to the graphics area This menu was created in graphics mode; hires, I think In BASIC, we had different screen modes, which offered varying column sizes and screen resolutions By the way, a similar centering technique is used to center the boxes in graphics mode Basically, instead of dealing with characters per row, you are dealing with pixels per row
Pixel Demonstration Randomize function for the Pixel command Basically, you are taking random coordinates within a coordinate system on screen and applying a pixel to those coordinates
Line Demo Randomize function for the line command The line command had a starting point (x1,y1) and an ending point (x2, y2) For people who took coordinate geometry or higher level mathematics, these are just coordinates
Box Demo Randomize function for the Line command with the Box option To create a box in Basic, you would still apply the four coordinates with the Line statement, but you would also apply the 'b' parameter to indicate a box Well, I think it is 'b'
Box-Fill Demo Randomize function for the Line command with the Box and Fill option The 'bf' option accomplishes this task, I think
Circle Demo Randomize function for the Circle command
Circle-Fill Demo Randomize function for the Circle command with the fill option
Arc Demo Randomize function for the Circle command with the arc option The arc option is actually another mathematical concept If I remember, the arc has a start and end point and is based in radians Even if you hate math, you should check out radian measure and the circle command Just imagine, one line of code could create a pac-man
Get/Put Demo Although the previous demos simulated animation, it left residuals on the screen Use the Get and Put commands to create animation You capture a rectangular area using Get and then you can apply anywhere else on the screen using Put If I can recall, you also need to use Get for an empty space to remove the last image
Draw Demo I definitely need to look at the code for this one, but most likely, I am using the Draw command along with some looping structure
Line Tile Patterns Demo Check out these line patterns They are similar to the ones you use in today's word processing and presentation programs
Paint Tile Patterns Demo This is another instance where I had to use graphing paper to sketch a pattern The tricky part is making sure you create a pattern that repeats evenly Use the Paint command to apply your patterns as a fill Fortunately, you do not have to worry about creating patterns by hand anymore unless you are a graphic designer
Palette Chart Demo Look at all these colors I think there should be about 256 available colors in this resolution In addition, it was possible swap colors Come to think about it, these are good game design colors
Sample Programs
Sample Programs Menu Another graphical menu From looking at it, I can see, I did random pixels first and a box with a tiling pattern The rest is just text; however, the menu title is some sort of overlay I probably used a function that addresses the memory to get the overlay effect
Sunshine This is truly nice also Even better is that I probably did not use a lot of code to produce this effect
Color Ellipses Looping function which cycles through different colors as each ellipse is drawn
Color Circles I think I have nested loops for this program
Circling in Orbit Yes, yet another mathematical situation applied to graphics I forgot how I did this, but it rotates a ball around the sun; well, another ball I did this program a few years after Trigonometry, so it is possible I used some of those techniques
Hat-Main Animation This is a good example of how easy the game pac-man could be done I should not use the word easy, but this program simulates a hat-man chomping across the screen
Triangle in Space Another animation program Animation is so important today; and believe it or not, even more important yesterday This one involves a triangle lost in space; and as I get and put positions, the triangle randomly rotates The triangle does not jump though; it kind of floats
Flying Saucer Get the trend? I loved animation back then The flying saucer was created in a different resolution to maximize colors Again, I hand-drew it first and used Get and Put for animation The saucer flies across the screen and goes up or down at the same time The fire also comes on and off randomly
Splash Screen
Clown Face Unfortunately, I did not draw this clown This was a lesson or test in imaging loading I think this image is saved as a file and I utilize the Bload command to bring it to screen
Exit this Program
Do You Really Want to Leave? Back to text Simple Yes/No prompt
0 comments
Post a comment