home *** CD-ROM | disk | FTP | other *** search
-
- #include <proto/games.h>
- #include <proto/exec.h>
-
- struct GMSBase *GMSBase;
- extern struct ExecBase *SysBase;
-
- #define AMT_PIXELS 32
-
- ULONG Palette[] =
- {
- 0x000000,0x101010,0x171717,0x202020,0x272727,0x303030,0x373737,0x404040,
- 0x474747,0x505050,0x575757,0x606060,0x676767,0x707070,0x777777,0x808080,
- 0x878787,0x909090,0x979797,0xa0a0a0,0xa7a7a7,0xb0b0b0,0xb7b7b7,0xc0c0c0,
- 0xc7c7c7,0xd0d0d0,0xd7d7d7,0xe0e0e0,0xe0e0e0,0xf0f0f0,0xf7f7f7,0xffffff
- };
-
- PIXELLIST(AMT_PIXELS) = {
- AMT_PIXELS,sizeof(struct PixelEntry),
- 160,128,0, 160,128,1, 160,128,2, 160,128,3, 160,128,4, 160,128,5,
- 160,128,6, 160,128,7, 160,128,8, 160,128,9, 160,128,10, 160,128,11,
- 160,128,12, 160,128,13, 160,128,14, 160,128,15, 160,128,16, 160,128,17,
- 160,128,18, 160,128,19, 160,128,20, 160,128,21, 160,128,22, 160,128,23,
- 160,128,24, 160,128,25, 160,128,26, 160,128,27, 160,128,28, 160,128,29,
- 160,128,30, 160,128,31
- };
-
- struct GameScreen *GameScreen;
-
- /*=========================================================================*/
-
- void main(void)
- {
- UWORD i;
- ULONG mouse;
-
- if (GMSBase = (struct GMSBase *) OpenLibrary("games.library",0))
- {
- SetUserPrefs(0);
- if (AllocBlitter() == NULL)
- {
- if (GameScreen = AddScreenTags(TAGS,NULL,
- GSA_Planes,5,
- GSA_Palette,Palette,
- GSA_ScrMode,LORES|COL24BIT,
- GSA_ScrWidth,320,
- GSA_ScrHeight,256,
- GSA_ScrType,INTERLEAVED,
- GSA_Attrib,DBLBUFFER,
- TAGEND)) {
-
- InitJoyPorts();
- ShowScreen(GameScreen);
-
- do {
- ClrScreen(GameScreen,BUFFER2);
-
- for(i=0; i<(AMT_PIXELS-1); i++) {
- PixelList.Entry[i].YCoord += 1; /* Y Coord down 1 */
- if ((PixelList.Entry[i].Colour -= 1) < 0) /* Colour value down 1 */
- PixelList.Entry[i].Colour = 1;
- }
-
- mouse = ReadJoyPort(JPORT1,JT_ZBXY);
- PixelList.Entry[AMT_PIXELS-1].XCoord += (BYTE)(mouse>>8)+(FastRandom(3)-1);
- PixelList.Entry[AMT_PIXELS-1].YCoord += (BYTE)(mouse)+(FastRandom(3)-1);
-
- for(i=0; i<(AMT_PIXELS-1); i++)
- PixelList.Entry[i] = PixelList.Entry[i+1];
-
- DrawPixelList(GameScreen,BUFFER2,&PixelList);
- WaitSVBL();
- SwapBuffers(GameScreen);
- } while (!(mouse & MB_LMB));
-
- DeleteScreen(GameScreen);
- }
- FreeBlitter();
- }
- CloseLibrary((struct Library *)GMSBase);
- }
- }
-
- /*=========================================================================*/
-
-