HOME COMPUTER GRAPHIC GAMES

Graphic Games HOME COMPUTER GRAPHIC GAMES. Arcade Amusement Games at Home. Character images, represented on high resolution screens, move and rotate (...
Author: Linda Short
0 downloads 2 Views 366KB Size
Graphic Games HOME COMPUTER GRAPHIC GAMES. Arcade Amusement Games at Home. Character images, represented on high resolution screens, move and rotate (See Graphics #1 and #2). Special game pads move figures or cursors to use keyboard keys. Many graphic games sold commercially can be on a network. 1. Games. Games, i.e. Doom, are packaged in computer CD's, or floppy disks. 2. Controls. Purchase Joystick or control pads to connect. 3. Maze. Many times game objects is to find a way out of labyrinths. Dolphins rams rocks in Sega Ecco to open tunnels. Graphics images are panned and zoomed. 4. Transfer Technology. Young people are interested in computer techniques. 5. Memory Chips. Entertainment games systems are on electronic cartridge circuit boards. Basic Game. Write programs for computer graphics games and sports drills. Move game characters across screens. Java Graphic. Use applets. Web Page. Create home pages. COPY Graphics Basic Program Code. Download graphics games. Programs published on a MEMBER directory give novice computer programmer an idea of how computer feedback mechanisms work using limited numbers of input function keys. Floppy Disks. Copy program listings. Store programs on disks. Change programs through keyboards. Use ((Shift) and (Delete) or (Insert)). Use right mouse menu buttons. SAVE program code with program code file name and subdirectory. CALL programs. Download Latest Java Compilers. Copy visual applet graphics examples. DOS SCREEN MODE RESOLUTION. Area Graphics. Define rectangular areas of the screens or applet in which to use graphic data representations in computer programs. The number of characters placed in a comparable area of screens determine resolution quality of computers. Primitive levels use low screen resolution. Better pictures use more values per screen area. Generate higher quality pictures. Vary coordinate ranges between zero and maximum X and Y values. Screen Modes from Low to High. Change number of pixels used for Gold Star DOS (See Allscreens in APPENDIX\III).  Low resolution in Screen zero (0). Represents text mode only. Use 320 for Y and 200 for X. Screen one (1) uses a special palette code of zero and one for even and odd palette attributes.  Medium Resolution in Screen Seven (7) Use two, four or eight pages to store screens in memory. Avoid flicker in solid figures. Switch from actual to visual screen pages. Use three hundred twenty by 200 pixels.  Higher Screen Resolution levels in Screen Eight (8) and Screen Nine (9). Use 640 x 350 pixels in screen 9. Use in computer model representations with page memory buffers. Copy pages from one buffer or array to another with pcopy statements. Adjust X and Y axis variables from single pixel graphic representation to higher resolution programs. zero (0) to six hundred and forty (640) for Y zero (0) to three hundred and twenty (350) for X Locate images on screens. Convert programs. Place Text on Screen in X and Y Coordinates. Place starting characters of words or phrases different positions on a screen or applet. LOCATE COMMAND (Locate X,Y). 1. Give values for vertical rows by Y coordinates. 2. Give horizontal X axis positions. 3. Determine columns and rows. Graphics Representation in X and Y Coordinates. Locate Points. Establish initial pset command point. PSET ( 0,0). Begin Figures. Vary X and Y (row and column) position counters on screens. Upper left corner coordinates is zero (0)

Chapter 9

364

Graphic Games for X and zero (0) for Y. Enter into the command prompt level of Basic. Enter graphical mode. Use DIMension data arrays. Enter TI99 Call Screen(1) DOS Screen 7 Move the Cursor or a Character. Create TI99 CHARacters. Use DOS characters, such as "line" or "corner". Use direction (arrow) keys. Control movement of cursers or graphical characters up or down, right or left across screens with function keys. Gwbasic mouse. Gwbasic can position a mouse cursor after locate. ADD COLOR AND SOUNDS TO GRAPHICAL OUTPUT MODELS. Start with Simple Screen Figures. Represent graphic figures such as circles, and lines. Use Excel graphics. Color Codes. - Gold Star Black 0 Blue 1 Green 2 Cyan 3 Red 4 Magenta 5 Brown 6 White 7 Gray 8 Light blue 9 Light green 10 Light cyan 11 Light red 12 Light magenta 13 Yellow 14 White 15 TI99 - Color Codes. Transparent 1 Black 2 Medium green 3 Light Green 4 Dark Blue 5 Light Blue 6 Dark Red 7 Cyan 8 Medium Red 9 Light Red 0 Dark Yellow 11 Light Yellow 1 Dark Green 13 Magenta 14 Gray 15 White 16 GOLD STAR COLOR. Palette. Use color on all screens except Screen two (2). Assign colors to attributes by palette commands. Use color or paint statements. Palette commands can also use DIMension arrays (See color programs in APPENDIX\III\). PAINT OR COLOR FILL FIGURES. Color Codes. - Gold Star. Colors vary. Determine colors of different screen resolutions. Enter Color 1, 63 for DOS. High resolution screens offered sixty four colors (See APPENDIX\III\ COLOR64). Color Fill. Fill figures with color values. Color lines. Use paint commands in that figure. Colors of lines may be the same as the paint color (See Copalette in APPENDIX/III). Use color in Excel 7. DRAW FIGURES. Construct Geometric Figures on High Resolution Screens. Easily draw figures on screens. Select circle commands to draw. Draw circles, ellipses or arches. Draw boxes with line commands. Use Box Fill (BF) parameter. Sprites used by older computers are longer needed.

Chapter 9

365

Graphic Games DRAW LINES. Draw Figures with Straight Lines on Screens. Establish points by pset. Draw figures with up, down, left or right or diagonal lines. PLACE TEXT OR FIGURES ON SCREEN. 1. Define vertical rows by Y coordinates. 2. Define horizontal positions on the X axis. 3. Use cells in Excel. Language Computer Prompt DOS Forms. Develop text displays. Add line graphics to views (See Chapter 4, Language Program Prompts). Choose portion of screens with view print commands. Language Model Code Example View Commands. View text. Set limits of rectangular blocks to display output with View commands. Scroll text from data files between the top and bottom lines given in this statement. Clear screens in this area with cls statements. Text in the view can also be colored. Border parameter can also be used in commands. Include an explanation prompt, if more than one graphical screen representation is needed. Graphics View. Window expands views beyond the screen field. Use view commands, in conjunction with window commands. Pan and zoom circle figures on screens (See Zoom in APPENDIX\III). Save screen displays as data on disk files by bsave commands. File names have (.bas) file name extensions. Use bload commands to load data on files to screens using def seg and "file name" enclosed in double quotes " " Obtain sizes of screen buffers from tables. Display the first screen while creating another screen. Then copy displays to a second screen page from disk by pcopy commands. Objective. Accumulate sets or collections of objects or items as progress is made in moving through a maze. The object can be recalled later for a special purpose in games. Store data in counters as games progress. PLACE AND REMOVE CHARACTERS TO ACHIEVE MOTION. Place Figure. Read a portion of the screen into a data array with a get statement. Graphic get statements load images from coordinates into numeric DIMension data arrays. Obtain characters from any location on screens in view. Remove Figure. Erase old character representation by using put XOR. Remove character images. Overlay old images with spaces or use Put XOR. Change Image. Display alternate characters on screens in one set of X and Y coordinates. Achieve movement on screens. Coordinate Variable. Use new X and Y coordinates. Put characters out on screens. Vary X and Y coordinates used by put or hchar. X coordinates moves characters in horizontal direction. Y coordinates moves characters in vertical positions. Vary values of one coordinate to another coordinate value. New Image. Retrieve data image from arrays in DIMension statements and place images on screens in another pixel location. Use put graphics command. Figure representation are moved to new X and Y coordinates on screens. Display new characters. Character appears to move from old coordinates to new coordinates. Delay loops helps achieve a better character movement. Do not reverse X and Y coordinate parameters in computer applications; that is, the Y coordinate may be first and the X second or the X coordinate may be first and the Y second. Give these characters valid X and Y value positions on screens or an error message results. USE CHARACTERS TO CREATE MOTION. Avoid Flicker. Use an active page and a visual page buffer in screen mode statements images. Create images and store in a page in memory. Change screens in a buffer. Display actual screen page image, in memory, on screen monitors. Use screen statements, when desired. Check Background for Character Movement. Check positions of a graphical character (or color) on monitors. Check one position in front or one position in back of characters. Look for specific background character representations in a screen buffer.

Chapter 9

366

Graphic Games

Figure 1ode

Basketball #1, Program Pie Chart Compare Code. Convert this background character to an ASC value for computer program analysis. Compare this value with a list of values in a consecutive series of program compare statements or in a table in working storage. 1. 2. 3. 4.

Play a sound. Flash or blink characters Change the position of a character representation on the monitor. Signal the end of the game.

No Match. If no match is found, the computer program waits for another function key input. Match. If a match is found, branch to other code. CREATE MUSIC OR SOUNDS. Musical Note Sounds with Play Commands. Play notes in both background and foreground environments. Put musical notes in background buffers so that other events can occur while notes are sounded. Vary the length of notes to quarter notes, full notes etc. (See SONG in APPENDIX\III). BASKETBALL PLAY DRILLS. Set Up Simple Initial Graphics See Analysis for Gwbasic Basketball Drill Program models in APPENDIX\III. Develop computer graphics screens in steps. Use stick figures in Basketball Drills program models in this Chapter (See Joseph

Chapter 9

367

Graphic Games Hartley, Complete Handbook of Basketball Drills). Begin movement. Move one player figure character down one path. Count the number of paces down the screen. Move player figures across the screen. Change Logic. On a specified number of paces, take appropriate action, such as to pass the ball. Adjust the path of player figures to present different models. Add additional characters such as defensive players. More complex models have additional movement. Draw stick figures. Use draw and circle commands. Place one of two figures on screens. 1. Man1 is in one graphical display figure. 2. Man9 is in the other. 3. man1 and man9

COMMAND PROGRAM LINE NUMBER screen 140 pset 260 820 670 690 put 230 310 610 620 630 720 730 760 770 800 810 820 960 970 1020 1030 1060 1070 1130 1140 1150 1270 1290 1350 put XOR 230 310 720 770 810 820 960 970 1060 1140 1290 get 220 300 710 draw 270 290 680 700 line 210 340 350 360 640 paint 200 circle 190 250 660 locate 170 390 430 470 550 590 850 950 1330 Analysis - Basketball Program Command Line Code Index Set up DIMension arrays in the beginning of programs. Hold screen areas covered by one man (within the square) in DIMension statement arrays. Put character figures in DIMension statements. Retrieve character figures with get. Remove characters from one position on the screen. Use Put with an XOR. COPY. LOAD Gwbasic programs. Test Example Program Analysis. Use Gwbasic line numbers. Find line numbers of each program graphics command indicated. Use code line numbers to find color statements. SEARCH for colors in Qbasic. Remove Old Graphic. Remove graphic characters with put XOR commands. See put XOR and put commands in the Basketball index. Change Circles. Change circle commands in any line from the Code Line Analysis. BASKETBALL DRILLS 100 DIM MAN9(500) 110 DIM MAN(500) 120 DIM BALL(500) 130 CLS 140 SCREEN 7,3,1,1 150 X=10 160 Y=1 170 LOCATE Y,X

Chapter 9

368

Graphic Games 180 PRINT "basketball" 190 CIRCLE (100,100),3,2 200 PAINT (101,101),2 210 REM LINE (95,95)-(105,105), 2,B 220 GET (95,95)-(105,105),BALL 230 PUT (95,95),BALL,XOR 240 REM start 250 CIRCLE (150,145),4,3 260 PSET (140,165) 270 DRAW "e10f10" 280 PSET (145,155) 290 DRAW "e5f5" 300 GET (140,140)-(165,165), MAN 310 PUT (140,140),MAN,XOR 320 START=70 330 F2=100 340 LINE (200,50)-(300,50) 350 LINE (200,130) -(300,130) 360 LINE (300,50)-(300,130)370 X=24 380 Y=16 390 LOCATE Y,X 400 PRINT "x" 410 X=14 420 Y=20 430 LOCATE Y,X 440 PRINT "x" 450 X=14 460 Y=8 470 LOCATE Y,X 480 PRINT "x" 490 H1$="two points" 500 PASS$="pass" 510 REM f=15 520 F1=10 530 X=10 540 Y=2 550 LOCATE Y,X 560 PRINT "pass and go" 570 X=1 580 Y=8 590 LOCATE Y,X 600 PRINT PASS$ 610 PUT (20,START+10),MAN 620 PUT (START,70),BALL 630 PUT(100,100),MAN 640 LINE (140,140)-(165,165), 2,B 660 CIRCLE (150,145),4,3 670 PSET (150,154) 680 DRAW "d10" 690 PSET (145,155)

Chapter 9

369

Graphic Games 700 DRAW "e5f5" 710 GET (140,140)-(165,165), MAN9 720 PUT (START,70),BALL,XOR 730 PUT (20,START+10),BALL 740 FOR DELAY=1 TO 5000 750 NEXT DELAY 760 PUT (60,START+20),BALL 770 PUT (20,START+10),BALL,XOR 780 FOR DELAY=1 TO 5000 790 NEXT DELAY 800 PUT (90,START +30),BALL 810 PUT (60,START+20),BALL,XOR 820 PUT (20,START+10),MAN,XOR 830 X=1 840 Y=8 850 LOCATE Y,X 860 PRINT " " 870 FOR I=20 TO 260 STEP 10 880 F1=F1+10 890 IF F1=100 THEN 930 900 IF I>100 THEN 1000 910 J=J+10 920 GOTO 1030 930 Y=8 940 X=1 950 LOCATE Y,X 960 PUT (90,START+30),BALL,XOR 970 PUT (I,START+70),BALL,XOR 980 PRINT PASS$ 990 GOTO 1030 1000 J=J-5 BASKETBALL DRILLS 1010 F1=100 1020 PUT(I,START-10+J),BALL 1030 PUT(I,START+J),MAN 1040 FOR DELAY=1 TO 5000 1050 NEXT DELAY 1060 PUT (I,START+J),MAN,XOR 1070 PUT(I,START+J),MAN9 1080 FOR DELAY=10 TO 20 1090 NEXT DELAY 1100 IF F1