home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-27 | 42.4 KB | 1,504 lines |
- Newsgroups: comp.sources.x
- From: jonathan@Think.COM (Jonny Goldman)
- Subject: v19i008: xinvaders - space invaders for X, Part03/03
- Message-ID: <1993Mar8.220551.11950@sparky.imd.sterling.com>
- X-Md4-Signature: 4d52450ca3bf36bab7f5b0401be67afc
- Date: Mon, 8 Mar 1993 22:05:51 GMT
- Approved: chris@sparky.imd.sterling.com
-
- Submitted-by: jonathan@Think.COM (Jonny Goldman)
- Posting-number: Volume 19, Issue 8
- Archive-name: xinvaders/part03
- Environment: X11
- Supersedes: xinvaders: Volume 8, Issue 62-66
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: Imakefile base1.bit base2.bit explode1.bit explode2.bit
- # score.c shot.c spacer1.bit spacer2.bit sperma1.bit sperma2.bit
- # spermb1.bit spermb2.bit vader1a1.bit vader1a2.bit vader1b1.bit
- # vader1b2.bit vader2a2.bit vader2b1.bit vader2b2.bit vader3a1.bit
- # vader3a2.bit vader3b1.bit vader3b2.bit vaders.h vexplod1.bit
- # vexplod2.bit xinvaders.ma
- # Wrapped by chris@sparky on Mon Mar 8 15:41:52 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 3 (of 3)."'
- if test -f 'Imakefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Imakefile'\"
- else
- echo shar: Extracting \"'Imakefile'\" \(255 characters\)
- sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
- XLOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
- X
- XOBJS = spacers.o base.o widget.o main.o vaders.o shot.o score.o
- X
- XSRCS = spacers.c base.c widget.c main.c vaders.c shot.c score.c
- X
- XINCLUDES = -I$(TOP) -I$(TOP)/X11
- X
- XComplexProgramTarget(xinvaders)
- END_OF_FILE
- if test 255 -ne `wc -c <'Imakefile'`; then
- echo shar: \"'Imakefile'\" unpacked with wrong size!
- fi
- # end of 'Imakefile'
- fi
- if test -f 'base1.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'base1.bit'\"
- else
- echo shar: Extracting \"'base1.bit'\" \(527 characters\)
- sed "s/^X//" >'base1.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define base1_width 15
- X#define base1_height 10
- Xstatic char base1_bits[] = {
- X 0x80, 0x00, 0xc0, 0x01, 0xc0, 0x01, 0xe0, 0x03, 0xfe, 0x3f, 0xff, 0x7f,
- X 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f};
- END_OF_FILE
- if test 527 -ne `wc -c <'base1.bit'`; then
- echo shar: \"'base1.bit'\" unpacked with wrong size!
- fi
- # end of 'base1.bit'
- fi
- if test -f 'base2.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'base2.bit'\"
- else
- echo shar: Extracting \"'base2.bit'\" \(902 characters\)
- sed "s/^X//" >'base2.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define base2_width 30
- X#define base2_height 20
- Xstatic char base2_bits[] = {
- X 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00,
- X 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x03, 0x00,
- X 0x00, 0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0xfc, 0xff, 0xff, 0x0f,
- X 0xfc, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f,
- X 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f,
- X 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f,
- X 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f};
- END_OF_FILE
- if test 902 -ne `wc -c <'base2.bit'`; then
- echo shar: \"'base2.bit'\" unpacked with wrong size!
- fi
- # end of 'base2.bit'
- fi
- if test -f 'explode1.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'explode1.bit'\"
- else
- echo shar: Extracting \"'explode1.bit'\" \(536 characters\)
- sed "s/^X//" >'explode1.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define explode1_width 15
- X#define explode1_height 10
- Xstatic char explode1_bits[] = {
- X 0x80, 0x00, 0xc0, 0x01, 0xc0, 0x01, 0x20, 0x02, 0x3e, 0x3e, 0x0d, 0x50,
- X 0x15, 0x48, 0x6d, 0x5b, 0x65, 0x4b, 0xff, 0x7f};
- END_OF_FILE
- if test 536 -ne `wc -c <'explode1.bit'`; then
- echo shar: \"'explode1.bit'\" unpacked with wrong size!
- fi
- # end of 'explode1.bit'
- fi
- if test -f 'explode2.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'explode2.bit'\"
- else
- echo shar: Extracting \"'explode2.bit'\" \(911 characters\)
- sed "s/^X//" >'explode2.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define explode2_width 30
- X#define explode2_height 20
- Xstatic char explode2_bits[] = {
- X 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00,
- X 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x03, 0x00,
- X 0x00, 0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0xfc, 0xff, 0xff, 0x0f,
- X 0xfc, 0xff, 0xff, 0x0f, 0x07, 0x00, 0x00, 0x38, 0xf3, 0x00, 0x00, 0x33,
- X 0x33, 0x01, 0x80, 0x33, 0x33, 0x01, 0xc0, 0x30, 0x33, 0x39, 0xce, 0x30,
- X 0xf3, 0x6c, 0xdb, 0x31, 0x33, 0x6c, 0xdb, 0x30, 0x33, 0x38, 0xce, 0x30,
- X 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f};
- END_OF_FILE
- if test 911 -ne `wc -c <'explode2.bit'`; then
- echo shar: \"'explode2.bit'\" unpacked with wrong size!
- fi
- # end of 'explode2.bit'
- fi
- if test -f 'score.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'score.c'\"
- else
- echo shar: Extracting \"'score.c'\" \(1207 characters\)
- sed "s/^X//" >'score.c' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X/* score.c -- Print the score. */
- X
- X#include "vaders.h"
- X
- X#define SCORELABEL 10
- X#define SCOREPOS (SCORELABEL+15)
- X#define HILABEL (SCOREPOS+20)
- X#define HIPOS (HILABEL+15)
- X
- XPaintScore()
- X{
- X char scorestring[8];
- X XDrawImageString(dpy, labelwindow, scoregc, 0, SCORELABEL, "Score", 5);
- X sprintf(scorestring, "%6d ", score);
- X XDrawImageString(dpy, labelwindow, scoregc, 0, SCOREPOS, scorestring, 7);
- X if (nextbonus && score >= nextbonus) {
- X basesleft++;
- X ShowBase(basesleft-1, basegc);
- X bases = basesleft;
- X nextbonus = 0;
- X }
- X if (score > hiscore)
- X hiscore = score;
- X sprintf(scorestring, "%6d ", hiscore);
- X XDrawImageString(dpy, labelwindow, scoregc, 0, HILABEL, " High", 5);
- X XDrawImageString(dpy, labelwindow, scoregc, 0, HIPOS, scorestring, 7);
- X}
- X
- XInitScore()
- X{
- X score = 0;
- X if (hiscore == 0) hiscore = -1;
- X basesleft = 3;
- X nextbonus = 1500;
- X}
- END_OF_FILE
- if test 1207 -ne `wc -c <'score.c'`; then
- echo shar: \"'score.c'\" unpacked with wrong size!
- fi
- # end of 'score.c'
- fi
- if test -f 'shot.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'shot.c'\"
- else
- echo shar: Extracting \"'shot.c'\" \(5223 characters\)
- sed "s/^X//" >'shot.c' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X/* shot.c - handle movement, etc. of the shots. */
- X
- X#include "vaders.h"
- X
- Xextern int paused;
- X
- X#define MAXSHOTS 1
- X#define MAXVSHOTS 6
- X#define SHOTSIZE (8*scale)
- X
- Xtypedef struct _ShotRec {
- X int x, y; /* Location of this shot. */
- X} ShotRec, *Shot;
- X
- XShotRec shots[MAXSHOTS], vshots[MAXVSHOTS];
- X
- XXImage *vshot_image[2];
- X
- Xstatic int tick = 0;
- X
- Xint numshots; /* Number of shots currently flying. */
- Xint numvshots; /* Number of shots currently flying. */
- X
- Xstatic void PaintShot(shot, gc)
- XShot shot;
- XGC gc;
- X{
- X AddLine(shot->x, shot->y,
- X shot->x, shot->y + SHOTSIZE, gc);
- X}
- X
- Xstatic void PaintVshot(vshot, gc)
- XShot vshot;
- XGC gc;
- X{
- X XPutImage(dpy, gamewindow, gc, vshot_image[tick],
- X 0, 0, vshot->x, vshot->y, vshot_image[tick]->width, vshot_image[tick]->height);
- X}
- X
- X
- Xvoid PaintAllShots()
- X{
- X int i;
- X for (i=0 ; i<numshots ; i++)
- X PaintShot(shots + i, shotgc);
- X for (i=0 ; i<numvshots ; i++)
- X PaintVshot(vshots + i, vshotgc);
- X}
- X
- X
- Xstatic void DestroyShot(i)
- Xint i;
- X{
- X PaintShot(shots + i, backgc);
- X numshots--;
- X shots[i] = shots[numshots];
- X}
- X
- X
- Xstatic void DestroyVshot(i)
- Xint i;
- X{
- X PaintVshot(vshots + i, backgc);
- X numvshots--;
- X vshots[i] = vshots[numvshots];
- X}
- X
- X/*ARGSUSED*/
- Xvoid MoveShots(closure, id)
- XOpaque closure;
- XXtIntervalId id;
- X{
- X int i, x, y, newy;
- X Shot shot;
- X if (closure != (Opaque) MoveShots) return;
- X if (!paused) {
- X if (numshots > 0)
- X shottimerid = XtAddTimeOut(shotwait, MoveShots, (Opaque) MoveShots);
- X else
- X shottimerid = NULL;
- X for (i=0 ; i<numshots ; i++) {
- X shot = shots + i;
- X newy = shot->y - SHOTSIZE/2;
- X x = shot->x;
- X y = shot->y;
- X if (ShotHitsVader(x, y)
- X || ShotHitsSpacer(x, y)
- X || ShotHitsBuilding(x, y)
- X || y < 0) {
- X DestroyShot(i);
- X i--; /* Ensures we don't skip moving a shot. */
- X } else {
- X PaintShot(shot, backgc);
- X shot->y = newy;
- X PaintShot(shot, shotgc);
- X }
- X }
- X }
- X}
- X
- XBoolean VshotHitsShot(x, y)
- Xint x, y;
- X{
- X int i, dx, dy;
- X Shot shot;
- X
- X for (i=0; i<numshots; i++) {
- X shot = shots + i;
- X dx = shot->x;
- X dy = shot->y;
- X if(dx >= x && dx < x+vshot_image[tick]->width
- X && dy >= y && dy < y+vshot_image[tick]->height) {
- X DestroyShot(i);
- X return TRUE;
- X }
- X }
- X return FALSE;
- X}
- X
- X/*ARGSUSED*/
- Xvoid MoveVshots(closure, id)
- XOpaque closure;
- XXtIntervalId id;
- X{
- X int i, x, y, newy;
- X Shot vshot;
- X
- X if (closure != (Opaque) MoveVshots) return;
- X if (!paused) {
- X if (numvshots > 0)
- X vshottimerid = XtAddTimeOut(vshotwait, MoveVshots, (Opaque) MoveVshots);
- X else
- X vshottimerid = NULL;
- X for (i=0 ; i<numvshots ; i++) {
- X vshot = vshots + i;
- X newy = vshot->y + 2*scale;
- X x = vshot->x;
- X y = vshot->y;
- X if (y>gameheight ||
- X VshotHitsShot(x, y) ||
- X ShotHitsBase(x,y) ||
- X ShotHitsBuilding(x,y)) {
- X DestroyVshot(i);
- X i--; /* Ensures we don't skip moving a shot. */
- X } else {
- X PaintVshot(vshot, backgc);
- X tick = tick ? 0 : 1;
- X vshot->y = newy;
- X PaintVshot(vshot, vshotgc);
- X tick = tick ? 0 : 1;
- X }
- X }
- X tick = tick ? 0 : 1;
- X }
- X}
- X
- X
- Xvoid AddShot(x, y)
- Xint x, y;
- X{
- X Shot shot;
- X if (numshots >= maxshots) return;
- X shot = shots + numshots;
- X numshots++;
- X shot->x = x;
- X shot->y = y-SHOTSIZE;
- X PaintShot(shot, shotgc);
- X if (shottimerid == NULL)
- X shottimerid = XtAddTimeOut(shotwait, MoveShots, (Opaque) MoveShots);
- X}
- X
- Xvoid AddVshot(x, y)
- Xint x, y;
- X{
- X Shot shot;
- X if (numvshots >= maxvshots) return;
- X shot = vshots + numvshots;
- X numvshots++;
- X shot->x = x;
- X shot->y = y;
- X PaintVshot(shot, vshotgc);
- X if (vshottimerid == NULL)
- X vshottimerid = XtAddTimeOut(shotwait, MoveVshots, (Opaque) MoveVshots);
- X}
- X
- X#include "sperma1.bit"
- X#include "sperma2.bit"
- X#include "spermb1.bit"
- X#include "spermb2.bit"
- X
- Xint ReadVshotImages()
- X{
- X vshot_image[0] = XCreateImage(dpy,
- X DefaultVisual(dpy, DefaultScreen(dpy)),
- X 1,
- X XYBitmap,
- X 0,
- X (scale == 1) ? sperma1_bits : sperma2_bits,
- X (scale == 1) ? sperma1_width : sperma2_width,
- X (scale == 1) ? sperma1_height : sperma2_height,
- X 8, 0);
- X vshot_image[0]->bitmap_bit_order = LSBFirst;
- X vshot_image[0]->byte_order = LSBFirst;
- X
- X vshot_image[1] = XCreateImage(dpy,
- X DefaultVisual(dpy, DefaultScreen(dpy)),
- X 1,
- X XYBitmap,
- X 0,
- X (scale == 1) ? spermb1_bits : spermb2_bits,
- X (scale == 1) ? spermb1_width : spermb2_width,
- X (scale == 1) ? spermb1_height : spermb2_height,
- X 8, 0);
- X vshot_image[1]->bitmap_bit_order = LSBFirst;
- X vshot_image[1]->byte_order = LSBFirst;
- X
- X return BitmapSuccess;
- X}
- X
- XInitShot()
- X{
- X shottimerid = NULL;
- X numshots = 0;
- X vshottimerid = NULL;
- X numvshots = 0;
- X if( ReadVshotImages() != BitmapSuccess) {
- X fprintf(stderr, "Error reading vshot images.\n");
- X exit(20);
- X }
- X}
- X
- Xvoid AddLine(fromx, fromy, tox, toy, gc)
- Xint fromx, fromy, tox, toy;
- XGC gc;
- X{
- X XDrawLine(dpy, gamewindow, gc, fromx, fromy, tox, toy);
- X}
- END_OF_FILE
- if test 5223 -ne `wc -c <'shot.c'`; then
- echo shar: \"'shot.c'\" unpacked with wrong size!
- fi
- # end of 'shot.c'
- fi
- if test -f 'spacer1.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'spacer1.bit'\"
- else
- echo shar: Extracting \"'spacer1.bit'\" \(508 characters\)
- sed "s/^X//" >'spacer1.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define spacer1_width 16
- X#define spacer1_height 8
- Xstatic char spacer1_bits[] = {
- X 0xc0, 0x03, 0xf0, 0x0f, 0xf8, 0x1f, 0xfc, 0x3f, 0xb6, 0x6d, 0xff, 0xff,
- X 0x1c, 0x38, 0x08, 0x10};
- END_OF_FILE
- if test 508 -ne `wc -c <'spacer1.bit'`; then
- echo shar: \"'spacer1.bit'\" unpacked with wrong size!
- fi
- # end of 'spacer1.bit'
- fi
- if test -f 'spacer2.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'spacer2.bit'\"
- else
- echo shar: Extracting \"'spacer2.bit'\" \(809 characters\)
- sed "s/^X//" >'spacer2.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define spacer2_width 32
- X#define spacer2_height 16
- Xstatic char spacer2_bits[] = {
- X 0x00, 0xf0, 0x0f, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x00,
- X 0x00, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0x03,
- X 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0x38, 0xcf, 0xf3, 0x1c,
- X 0x38, 0xcf, 0xf3, 0x1c, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
- X 0xf0, 0x03, 0xc0, 0x0f, 0xf0, 0x03, 0xc0, 0x0f, 0xc0, 0x00, 0x00, 0x03,
- X 0xc0, 0x00, 0x00, 0x03};
- END_OF_FILE
- if test 809 -ne `wc -c <'spacer2.bit'`; then
- echo shar: \"'spacer2.bit'\" unpacked with wrong size!
- fi
- # end of 'spacer2.bit'
- fi
- if test -f 'sperma1.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sperma1.bit'\"
- else
- echo shar: Extracting \"'sperma1.bit'\" \(450 characters\)
- sed "s/^X//" >'sperma1.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define sperma1_width 3
- X#define sperma1_height 7
- Xstatic char sperma1_bits[] = {
- X 0x02, 0x01, 0x02, 0x04, 0x02, 0x01, 0x02};
- END_OF_FILE
- if test 450 -ne `wc -c <'sperma1.bit'`; then
- echo shar: \"'sperma1.bit'\" unpacked with wrong size!
- fi
- # end of 'sperma1.bit'
- fi
- if test -f 'sperma2.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sperma2.bit'\"
- else
- echo shar: Extracting \"'sperma2.bit'\" \(496 characters\)
- sed "s/^X//" >'sperma2.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define sperma2_width 6
- X#define sperma2_height 14
- Xstatic char sperma2_bits[] = {
- X 0x0c, 0x0c, 0x03, 0x03, 0x0c, 0x0c, 0x30, 0x30, 0x0c, 0x0c, 0x03, 0x03,
- X 0x0c, 0x0c};
- END_OF_FILE
- if test 496 -ne `wc -c <'sperma2.bit'`; then
- echo shar: \"'sperma2.bit'\" unpacked with wrong size!
- fi
- # end of 'sperma2.bit'
- fi
- if test -f 'spermb1.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'spermb1.bit'\"
- else
- echo shar: Extracting \"'spermb1.bit'\" \(450 characters\)
- sed "s/^X//" >'spermb1.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define spermb1_width 3
- X#define spermb1_height 7
- Xstatic char spermb1_bits[] = {
- X 0x02, 0x04, 0x02, 0x01, 0x02, 0x04, 0x02};
- END_OF_FILE
- if test 450 -ne `wc -c <'spermb1.bit'`; then
- echo shar: \"'spermb1.bit'\" unpacked with wrong size!
- fi
- # end of 'spermb1.bit'
- fi
- if test -f 'spermb2.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'spermb2.bit'\"
- else
- echo shar: Extracting \"'spermb2.bit'\" \(496 characters\)
- sed "s/^X//" >'spermb2.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define spermb2_width 6
- X#define spermb2_height 14
- Xstatic char spermb2_bits[] = {
- X 0x0c, 0x0c, 0x30, 0x30, 0x0c, 0x0c, 0x03, 0x03, 0x0c, 0x0c, 0x30, 0x30,
- X 0x0c, 0x0c};
- END_OF_FILE
- if test 496 -ne `wc -c <'spermb2.bit'`; then
- echo shar: \"'spermb2.bit'\" unpacked with wrong size!
- fi
- # end of 'spermb2.bit'
- fi
- if test -f 'vader1a1.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vader1a1.bit'\"
- else
- echo shar: Extracting \"'vader1a1.bit'\" \(511 characters\)
- sed "s/^X//" >'vader1a1.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define vader1a1_width 10
- X#define vader1a1_height 8
- Xstatic char vader1a1_bits[] = {
- X 0x30, 0x00, 0x78, 0x00, 0xfc, 0x00, 0xb6, 0x01, 0xfe, 0x01, 0xb4, 0x00,
- X 0x02, 0x01, 0x84, 0x00};
- END_OF_FILE
- if test 511 -ne `wc -c <'vader1a1.bit'`; then
- echo shar: \"'vader1a1.bit'\" unpacked with wrong size!
- fi
- # end of 'vader1a1.bit'
- fi
- if test -f 'vader1a2.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vader1a2.bit'\"
- else
- echo shar: Extracting \"'vader1a2.bit'\" \(710 characters\)
- sed "s/^X//" >'vader1a2.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define vader1a2_width 20
- X#define vader1a2_height 16
- Xstatic char vader1a2_bits[] = {
- X 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0xc0, 0x3f, 0x00, 0xc0, 0x3f, 0x00,
- X 0xf0, 0xff, 0x00, 0xf0, 0xff, 0x00, 0x3c, 0xcf, 0x03, 0x3c, 0xcf, 0x03,
- X 0xfc, 0xff, 0x03, 0xfc, 0xff, 0x03, 0x30, 0xcf, 0x00, 0x30, 0xcf, 0x00,
- X 0x0c, 0x00, 0x03, 0x0c, 0x00, 0x03, 0x30, 0xc0, 0x00, 0x30, 0xc0, 0x00};
- END_OF_FILE
- if test 710 -ne `wc -c <'vader1a2.bit'`; then
- echo shar: \"'vader1a2.bit'\" unpacked with wrong size!
- fi
- # end of 'vader1a2.bit'
- fi
- if test -f 'vader1b1.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vader1b1.bit'\"
- else
- echo shar: Extracting \"'vader1b1.bit'\" \(511 characters\)
- sed "s/^X//" >'vader1b1.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define vader1b1_width 10
- X#define vader1b1_height 8
- Xstatic char vader1b1_bits[] = {
- X 0x30, 0x00, 0x78, 0x00, 0xfc, 0x00, 0xb6, 0x01, 0xfe, 0x01, 0xb4, 0x00,
- X 0x48, 0x00, 0x84, 0x00};
- END_OF_FILE
- if test 511 -ne `wc -c <'vader1b1.bit'`; then
- echo shar: \"'vader1b1.bit'\" unpacked with wrong size!
- fi
- # end of 'vader1b1.bit'
- fi
- if test -f 'vader1b2.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vader1b2.bit'\"
- else
- echo shar: Extracting \"'vader1b2.bit'\" \(710 characters\)
- sed "s/^X//" >'vader1b2.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define vader1b2_width 20
- X#define vader1b2_height 16
- Xstatic char vader1b2_bits[] = {
- X 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0xc0, 0x3f, 0x00, 0xc0, 0x3f, 0x00,
- X 0xf0, 0xff, 0x00, 0xf0, 0xff, 0x00, 0x3c, 0xcf, 0x03, 0x3c, 0xcf, 0x03,
- X 0xfc, 0xff, 0x03, 0xfc, 0xff, 0x03, 0x30, 0xcf, 0x00, 0x30, 0xcf, 0x00,
- X 0xc0, 0x30, 0x00, 0xc0, 0x30, 0x00, 0x30, 0xc0, 0x00, 0x30, 0xc0, 0x00};
- END_OF_FILE
- if test 710 -ne `wc -c <'vader1b2.bit'`; then
- echo shar: \"'vader1b2.bit'\" unpacked with wrong size!
- fi
- # end of 'vader1b2.bit'
- fi
- if test -f 'vader2a2.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vader2a2.bit'\"
- else
- echo shar: Extracting \"'vader2a2.bit'\" \(710 characters\)
- sed "s/^X//" >'vader2a2.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define vader2a2_width 24
- X#define vader2a2_height 16
- Xstatic char vader2a2_bits[] = {
- X 0xc0, 0x00, 0x03, 0xc0, 0x00, 0x03, 0x00, 0xc3, 0x00, 0x00, 0xc3, 0x00,
- X 0xc0, 0xff, 0x03, 0xc0, 0xff, 0x03, 0xf0, 0x3c, 0x0f, 0xf0, 0x3c, 0x0f,
- X 0xfc, 0xff, 0x3f, 0xfc, 0xff, 0x3f, 0xcc, 0xff, 0x33, 0xcc, 0xff, 0x33,
- X 0xcc, 0x00, 0x33, 0xcc, 0x00, 0x33, 0x00, 0xc3, 0x00, 0x00, 0xc3, 0x00};
- END_OF_FILE
- if test 710 -ne `wc -c <'vader2a2.bit'`; then
- echo shar: \"'vader2a2.bit'\" unpacked with wrong size!
- fi
- # end of 'vader2a2.bit'
- fi
- if test -f 'vader2b1.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vader2b1.bit'\"
- else
- echo shar: Extracting \"'vader2b1.bit'\" \(511 characters\)
- sed "s/^X//" >'vader2b1.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define vader2b1_width 12
- X#define vader2b1_height 8
- Xstatic char vader2b1_bits[] = {
- X 0x08, 0x01, 0x92, 0x04, 0xfa, 0x05, 0x6e, 0x07, 0xfc, 0x03, 0xf8, 0x01,
- X 0x08, 0x01, 0x04, 0x02};
- END_OF_FILE
- if test 511 -ne `wc -c <'vader2b1.bit'`; then
- echo shar: \"'vader2b1.bit'\" unpacked with wrong size!
- fi
- # end of 'vader2b1.bit'
- fi
- if test -f 'vader2b2.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vader2b2.bit'\"
- else
- echo shar: Extracting \"'vader2b2.bit'\" \(710 characters\)
- sed "s/^X//" >'vader2b2.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define vader2b2_width 24
- X#define vader2b2_height 16
- Xstatic char vader2b2_bits[] = {
- X 0xc0, 0x00, 0x03, 0xc0, 0x00, 0x03, 0x0c, 0xc3, 0x30, 0x0c, 0xc3, 0x30,
- X 0xcc, 0xff, 0x33, 0xcc, 0xff, 0x33, 0xfc, 0x3c, 0x3f, 0xfc, 0x3c, 0x3f,
- X 0xf0, 0xff, 0x0f, 0xf0, 0xff, 0x0f, 0xc0, 0xff, 0x03, 0xc0, 0xff, 0x03,
- X 0xc0, 0x00, 0x03, 0xc0, 0x00, 0x03, 0x30, 0x00, 0x0c, 0x30, 0x00, 0x0c};
- END_OF_FILE
- if test 710 -ne `wc -c <'vader2b2.bit'`; then
- echo shar: \"'vader2b2.bit'\" unpacked with wrong size!
- fi
- # end of 'vader2b2.bit'
- fi
- if test -f 'vader3a1.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vader3a1.bit'\"
- else
- echo shar: Extracting \"'vader3a1.bit'\" \(511 characters\)
- sed "s/^X//" >'vader3a1.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define vader3a1_width 14
- X#define vader3a1_height 8
- Xstatic char vader3a1_bits[] = {
- X 0xe0, 0x01, 0xfc, 0x0f, 0xfe, 0x1f, 0xce, 0x1c, 0xfe, 0x1f, 0x38, 0x07,
- X 0xcc, 0x0c, 0x18, 0x06};
- END_OF_FILE
- if test 511 -ne `wc -c <'vader3a1.bit'`; then
- echo shar: \"'vader3a1.bit'\" unpacked with wrong size!
- fi
- # end of 'vader3a1.bit'
- fi
- if test -f 'vader3a2.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vader3a2.bit'\"
- else
- echo shar: Extracting \"'vader3a2.bit'\" \(812 characters\)
- sed "s/^X//" >'vader3a2.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define vader3a2_width 28
- X#define vader3a2_height 16
- Xstatic char vader3a2_bits[] = {
- X 0x00, 0xfc, 0x03, 0x00, 0x00, 0xfc, 0x03, 0x00, 0xf0, 0xff, 0xff, 0x00,
- X 0xf0, 0xff, 0xff, 0x00, 0xfc, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0x03,
- X 0xfc, 0xf0, 0xf0, 0x03, 0xfc, 0xf0, 0xf0, 0x03, 0xfc, 0xff, 0xff, 0x03,
- X 0xfc, 0xff, 0xff, 0x03, 0xc0, 0x0f, 0x3f, 0x00, 0xc0, 0x0f, 0x3f, 0x00,
- X 0xf0, 0xf0, 0xf0, 0x00, 0xf0, 0xf0, 0xf0, 0x00, 0xc0, 0x03, 0x3c, 0x00,
- X 0xc0, 0x03, 0x3c, 0x00};
- END_OF_FILE
- if test 812 -ne `wc -c <'vader3a2.bit'`; then
- echo shar: \"'vader3a2.bit'\" unpacked with wrong size!
- fi
- # end of 'vader3a2.bit'
- fi
- if test -f 'vader3b1.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vader3b1.bit'\"
- else
- echo shar: Extracting \"'vader3b1.bit'\" \(511 characters\)
- sed "s/^X//" >'vader3b1.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define vader3b1_width 14
- X#define vader3b1_height 8
- Xstatic char vader3b1_bits[] = {
- X 0xe0, 0x01, 0xfc, 0x0f, 0xfe, 0x1f, 0xce, 0x1c, 0xfe, 0x1f, 0x38, 0x07,
- X 0xcc, 0x0c, 0x06, 0x18};
- END_OF_FILE
- if test 511 -ne `wc -c <'vader3b1.bit'`; then
- echo shar: \"'vader3b1.bit'\" unpacked with wrong size!
- fi
- # end of 'vader3b1.bit'
- fi
- if test -f 'vader3b2.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vader3b2.bit'\"
- else
- echo shar: Extracting \"'vader3b2.bit'\" \(812 characters\)
- sed "s/^X//" >'vader3b2.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define vader3b2_width 28
- X#define vader3b2_height 16
- Xstatic char vader3b2_bits[] = {
- X 0x00, 0xfc, 0x03, 0x00, 0x00, 0xfc, 0x03, 0x00, 0xf0, 0xff, 0xff, 0x00,
- X 0xf0, 0xff, 0xff, 0x00, 0xfc, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0x03,
- X 0xfc, 0xf0, 0xf0, 0x03, 0xfc, 0xf0, 0xf0, 0x03, 0xfc, 0xff, 0xff, 0x03,
- X 0xfc, 0xff, 0xff, 0x03, 0xc0, 0x0f, 0x3f, 0x00, 0xc0, 0x0f, 0x3f, 0x00,
- X 0xf0, 0xf0, 0xf0, 0x00, 0xf0, 0xf0, 0xf0, 0x00, 0x3c, 0x00, 0xc0, 0x03,
- X 0x3c, 0x00, 0xc0, 0x03};
- END_OF_FILE
- if test 812 -ne `wc -c <'vader3b2.bit'`; then
- echo shar: \"'vader3b2.bit'\" unpacked with wrong size!
- fi
- # end of 'vader3b2.bit'
- fi
- if test -f 'vaders.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vaders.h'\"
- else
- echo shar: Extracting \"'vaders.h'\" \(4641 characters\)
- sed "s/^X//" >'vaders.h' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X/* vaders.h - definitions of vaders data structures. */
- X
- X#ifndef _vaders_h
- X#define _vaders_h
- X
- X#include <stdio.h>
- X#include <math.h>
- X#include <X11/Xlib.h>
- X#include <X11/Xos.h>
- X
- X/* #include <X11/Xutil.h> */
- X#include <X11/cursorfont.h>
- X
- X#include <X11/IntrinsicP.h>
- X#include <X11/StringDefs.h>
- X
- X#include <X11/Xaw/Command.h>
- X
- X#ifndef XtRFloat
- X#define XtRFloat "Float"
- X#endif
- X
- X#define rint(x) ((int) (x))
- X#define MIN(x, y) ((x) < (y) ? (x) : (y))
- X#define MAX(x, y) ((x) > (y) ? (x) : (y))
- X
- X#define VWIDTH 240
- X#define IWIDTH 75
- X#define VHEIGHT 190
- X
- X#ifndef M_PI
- X#define M_PI 3.14159265358979323846
- X#define M_PI_2 1.57079632679489661923
- X#define M_PI_4 0.78539816339744830962
- X#endif
- X
- X#ifdef MAIN
- X#define ext
- X#else
- X#define ext extern
- X#endif
- X
- X/*
- X * Definitions to make us act as a widget.
- X */
- X
- X/* New fields for the Vaders widget class record */
- Xtypedef struct {
- X int mumble; /* No new procedures */
- X} VadersClassPart;
- X
- X/* Full class record declaration */
- Xtypedef struct _VadersClassRec {
- X CoreClassPart core_class;
- X VadersClassPart vaders_class;
- X} VadersClassRec;
- X
- Xextern VadersClassRec vadersClassRec;
- Xextern WidgetClass vadersWidgetClass;
- X
- X/* New fields for the Vaders widget record */
- Xtypedef struct _VadersPart {
- X int dummy;
- X} VadersPart;
- X
- X
- X
- X/* Full instance record declaration */
- X
- Xtypedef struct _VadersRec {
- X CorePart core;
- X VadersPart vaders;
- X} VadersRec, *VadersWidget;
- X
- X
- X
- X
- X/*
- X * Actual vaders definitions.
- X */
- X
- Xext Widget pausebutton, infobutton;
- Xext int scale;
- X
- Xext Boolean debug;
- Xext int level;
- X
- Xext Display *dpy;
- Xext Window gamewindow, labelwindow;
- Xext VadersWidget gamewidget, labelwidget;
- Xext int gamewidth, gameheight;
- Xext Widget toplevel;
- Xext int score;
- Xext int basesleft;
- X
- X/* Base info: */
- X
- Xext int basewait; /* Number of milleseconds to wait between */
- X /* moving base. */
- X
- Xext XtIntervalId basetimerid;
- X
- Xext Pixel basepixel;
- Xext Pixel buildingpixel;
- Xext Boolean basedestroyed; /* TRUE if the base is non-existant */
- X
- X/* Vader info: */
- X
- Xext XtIntervalId vadertimerid;
- Xext Pixel vader1pixel;
- Xext Pixel vader2pixel;
- Xext Pixel vader3pixel;
- Xext int vaderwait; /* Number of milleseconds to wait between */
- X /* moving vaders. */
- X
- X/* Spacer info */
- X
- Xext Pixel spacerpixel;
- Xext XtIntervalId spacertimerid;
- Xext int spacerwait; /* Number of milliseconds to wait between
- X /* moving spacers. /*
- Xext int spacerappear; /* same, but for the interval between appearances */
- X
- Xext Boolean spacer_shown; /* Currnet_Spacer is something */
- Xext int spacer_counter; /* number of cycles to create a spacer */
- X
- X/* Shot info. */
- X
- Xext XtIntervalId shottimerid;
- Xext XtIntervalId vshottimerid;
- Xext Pixel shotpixel;
- Xext Pixel vshotpixel;
- Xext int shotwait;
- Xext int vshotwait;
- Xext int maxshots; /* How many shots are allowed to exist at */
- X /* once. */
- Xext int maxvshots; /* How many shots are allowed to exist at */
- X /* once. */
- Xext int numshots; /* how many shots (from the base) there are right now. */
- Xext int numvshots; /* how many shots (from vaders) there are right now. */
- X
- X/* Score info */
- X
- Xext Pixel scorepixel;
- X
- X
- Xext int bases, nextbonus, hiscore, lastscore;
- X
- X
- Xext GC
- X foregc, backgc, basegc, buildinggc, vadergc[3],
- X shotgc, vshotgc, spacergc, scoregc;
- X
- Xext XImage *me_image;
- X
- X/* From widget.c */
- X
- Xextern Boolean TakeFocus();
- Xextern void Quit();
- Xextern void Pause();
- Xextern int paused;
- Xextern void SuspendTimers();
- Xextern void EnableTimers();
- Xextern void ShowInfo();
- X
- X/* From base.c */
- X
- Xextern void MoveBase();
- Xextern void MoveLeft();
- Xextern void MoveRight();
- Xextern void Stop();
- Xextern void Fire();
- Xextern Boolean ShotHitsBase();
- Xextern Boolean ShotHitsBuilding();
- Xextern void InitBase();
- Xextern void PaintBase();
- Xextern void DrawBuildings();
- X
- X/* From vaders.c */
- X
- Xextern Boolean ShotHitsVader();
- Xextern void MoveVaders();
- Xextern void InitVaders();
- Xextern void AddVShot();
- Xextern void MoveVShots();
- Xextern void CreateVaders();
- Xextern void PaintAllVaders();
- X
- X/* from spacer.c */
- X
- Xextern Boolean ShotHitsSpacer();
- Xextern void MoveSpacer();
- Xextern void MakeSpacer();
- Xextern void InitSpacers();
- Xextern void PaintSpacer();
- X
- X/* From shot.c */
- X
- Xextern void AddLine();
- Xextern void AddShot();
- Xextern void AddVshot();
- Xextern void MoveShots();
- Xextern void MoveVshots();
- Xextern void PaintAllShots();
- Xext Pixel defaultfore, defaultback;
- X
- Xext char *vaderfont;
- X
- X#endif _vaders_h
- END_OF_FILE
- if test 4641 -ne `wc -c <'vaders.h'`; then
- echo shar: \"'vaders.h'\" unpacked with wrong size!
- fi
- # end of 'vaders.h'
- fi
- if test -f 'vexplod1.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vexplod1.bit'\"
- else
- echo shar: Extracting \"'vexplod1.bit'\" \(514 characters\)
- sed "s/^X//" >'vexplod1.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define vexplode1_width 14
- X#define vexplode1_height 8
- Xstatic char vexplode1_bits[] = {
- X 0x48, 0x04, 0x50, 0x02, 0x00, 0x00, 0x06, 0x18, 0x10, 0x02, 0x88, 0x04,
- X 0x80, 0x00, 0x00, 0x00};
- END_OF_FILE
- if test 514 -ne `wc -c <'vexplod1.bit'`; then
- echo shar: \"'vexplod1.bit'\" unpacked with wrong size!
- fi
- # end of 'vexplod1.bit'
- fi
- if test -f 'vexplod2.bit' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vexplod2.bit'\"
- else
- echo shar: Extracting \"'vexplod2.bit'\" \(815 characters\)
- sed "s/^X//" >'vexplod2.bit' <<'END_OF_FILE'
- X/*
- XCopyright notice:
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- XJonny Goldman <jonathan@think.com>
- X
- XWed May 8 1991
- X*/
- X
- X#define vexplode2_width 28
- X#define vexplode2_height 16
- Xstatic char vexplode2_bits[] = {
- X 0x00, 0x20, 0x00, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0xa8, 0x10, 0x00,
- X 0xc0, 0xa8, 0x0c, 0x00, 0x00, 0x03, 0x02, 0x00, 0x60, 0x00, 0x60, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x80, 0x00, 0x10, 0x00, 0x60, 0x04, 0x64, 0x00, 0x00, 0x53, 0x09, 0x00,
- X 0xc0, 0x50, 0x11, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x40, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00};
- END_OF_FILE
- if test 815 -ne `wc -c <'vexplod2.bit'`; then
- echo shar: \"'vexplod2.bit'\" unpacked with wrong size!
- fi
- # end of 'vexplod2.bit'
- fi
- if test -f 'xinvaders.ma' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xinvaders.ma'\"
- else
- echo shar: Extracting \"'xinvaders.ma'\" \(4073 characters\)
- sed "s/^X//" >'xinvaders.ma' <<'END_OF_FILE'
- X.\" Man page for xinvaders, by Jonny Goldman.
- X.TH XInvaders 2.0 "Wed May 8 1991"
- X.SH NAME
- X\fIXInvaders\fR \- Shoot-em-up them nasty little bugs.
- X.SH AUTHOR
- X.B Jonny Goldman (jonathan@think.com)
- X.SH SYNOPSIS
- X.B xinvaders
- X[-all_those_groovy_xtoolkit_switches]
- X.SH DESCRIPTION
- X.I xinvaders
- Xis an implementation of the old Atari Space Invaders game, on top of the
- XX11 window system.
- X
- X.SH PATCH LEVEL
- Xxinvaders is now at Version 2, Patch Level 0
- X
- X.SH PLAYING XINVADERS
- XThe game will start with all the invaders drawn. Press 'p' to play, and
- Xyou're off, or use the newly provided buttons.
- X
- XThe controls are:
- X
- X.PP
- X.TP 8
- X.B z
- XFire a shot. You will only be able to fire one shot at a time, so be careful.
- X.PP
- X.TP 8
- X.B ,
- XMove left. Pressing this key will start you moving to the left, releasing it
- Xwill make you stop.
- X.PP
- X.TP 8
- X.B .
- XMove right. Pressing this key will start you moving to the right, releasing it
- Xwill make you stop.
- X.PP
- X.TP 8
- X.B p
- XPause or Play. Pressing this will either pause the game, or play it.
- XRemember, you must press it to start the game (either at the very
- Xbeginning, or between new games).
- X.PP
- X.TP 8
- X.B q
- XQuit the game. Do this and you will end the game. No ifs, ands or buts
- Xabout it.
- X
- X.PP
- XThe mouse controls are active, and rather obvious:
- X
- X.PP
- X.TP 8
- X.B Left
- XMove left, as above
- X.PP
- X.TP 8
- X.B Middle
- XFire, as above
- X.PP
- X.TP 8
- X.B Right
- XMove right. ditto.
- X
- X
- X.SH SCORING
- X
- XThe lowest monsters are worth 10 points, the next are worth 20, and the
- Xhighest are worth 30. Space ships are worth anything from 50-300 points
- X(in 50 point increments, of course).
- X
- X
- X
- X.SH CUSTOMIZING COLORS
- X
- XAs with all standard X applications,
- X.I xinvaders
- Xmay be customized through entries in the resource manager. This game also
- Xworks on monochrome screens, but the colors don't mean anything (surprise!).
- X.PP
- X.TP 8
- X.B Scale
- XA switch that allows for multiple resolutions.
- X1 for normal resolution, 2 for 2x zoom (the default).
- X.PP
- X.TP 8
- X.B BaseColor
- XThe color for the Base (you). Default is white.
- X.PP
- X.TP 8
- X.B BuildingColor
- XThe color for the buildings that shield you. Default is yellow.
- X.PP
- X.TP 8
- X.B Vader1Color
- XThe color for the highest invaders. Default is blue.
- X.PP
- X.TP 8
- X.B Vader2Color
- XThe color for the middle invaders. Default is orange.
- X.PP
- X.TP 8
- X.B Vader3Color
- XThe color for the lowest invaders. Default is red.
- X.PP
- X.TP 8
- X.B SpacerColor
- XThe color for the Space Ship. Default is gray.
- X.PP
- X.TP 8
- X.B ShotColor
- XThe color for your shots. Default is green.
- X.PP
- X.TP 8
- X.B VshotColor
- XThe color for their shots. Default is pink.
- X.PP
- X.TP 8
- X.B ScoreColor
- XThe color for the score. Default is cyan.
- X
- X.PP
- XHere's an example of some of the resources you can set (this would be in
- Xyour .Xdefaults file):
- X
- X Vaders*Font: 9x15
- X Vaders*Scale: 2
- X Vaders*defaultfore: black
- X Vaders*defaultback: white
- X Vaders*Vader1Color: blue
- X Vaders*Vader2Color: green
- X Vaders*Vader3Color: red
- X Vaders*BaseColor: cyan
- X Vaders*BuildingColor: yellow
- X Vaders*SpacerColor: gray
- X Vaders*ShotColor: lavender
- X Vaders*VshotColor: orange
- X Vaders*BaseWait: 10
- X Vaders*VaderWait: 300
- X Vaders*SpacerWait: 50
- X Vaders*ShotWait: 10
- X Vaders*VshotWait: 30
- X
- X
- X
- X.SH NOTES
- X
- XThere are lots of resources. You can change all the timings involved.
- XHave fun with it.
- X
- XAlthough you can resize the gamewindow, I don't recommend it.
- X
- X.SH BUGS
- X
- XThe buildings aren't as good as the arcade, but hey, whatdayawant for free?
- XIt also doesn't handle auto-repeat very well, so you should probably turn
- Xit off.
- X
- X.SH COPYRIGHT
- X
- XThis is mine. I'm only letting you use it. Period. Feel free to rip off
- Xany of the code you see fit, but have the courtesy to give me credit.
- XOtherwise great hairy beasties will rip your eyes out and eat your flesh
- Xwhen you least expect it.
- X
- X.SH CREDITS
- X
- XI'd like to give a lot of credit to Terry Weissman for his roids games. It
- Xgave me the guidance on how to do something like this.
- END_OF_FILE
- if test 4073 -ne `wc -c <'xinvaders.ma'`; then
- echo shar: \"'xinvaders.ma'\" unpacked with wrong size!
- fi
- # end of 'xinvaders.ma'
- fi
- echo shar: End of archive 3 \(of 3\).
- cp /dev/null ark3isdone
- MISSING=""
- for I in 1 2 3 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 3 archives.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
- --
- // chris@IMD.Sterling.COM | Send comp.sources.x submissions to:
- \X/ Amiga - The only way to fly! |
- "It's intuitively obvious to the most | sources-x@imd.sterling.com
- casual observer..." |
-