Aucbarpa.1048
net.sources
utcsrgv!utzoo!decvax!ucbvax!ARPAVAX:mark
Sun Apr 4 15:19:32 1982
pacman/movie.c
/*
* "Movie" routine for Mark Horton's version of PACMAN which uses the
* curses library stuff. You could probably diddle with it a little
* and make it shorter/smaller, however, I haven't seen any document-
* ation on the "new" curses stuff (although we have it), so I don't
* know what I can get away with.
*
* NOTE: This routine was written for a 24 x 80 screen (adm3a, adm5).
* If your screen is different (columns matter, lines don't),
* you will have to change some things. It shouldn't be very
* difficult, but be warned.
*
* Dave Curry (pur-ee!davy)
*
*/
#include "pacdefs.h"
#include <CURSES.H>
/* This is the monster we use. Don't take out the extra spaces here,
* they are there so that the thing "cleans up" after itself, since
* I'm too lazy to move all over the place writing out spaces.
*/
char *bigmonster[] = {
" _____ ",
" / \\ ",
" | O O | ",
" v^v^v^v ",
};
movie()
{
int i, j, k;
clear();
refresh();
/*
* this loop moves the monster and the small pacman from right to
* left, until it's time to start printing "fractional" monsters
*/
for (i=70; i > (-1); i--) {
for (j=0; j 20) {
SPLOT(13, (i-20), "> ");
}
else {
SPLOT(13, 1, " ");
}
refresh();
}
/*
* left1-left7 are "partial" monster routines, they are also called when
* the monster comes back on from the left (called in opposite order)
*/
left1(); left2();
left3(); left4();
left5(); left6();
left7();
sleep(1);
/* Now we come back on... */
left7(); left6();
left5(); left4();
left3(); left2();
left1();
/*
* Now we start moving the big pacman across. monst1-monst3 are
* routines for drawing pieces of the pacman, until the whole thing
* is on the screen.
*/
for (i=0; i 20) {
switch(i) {
case 21:
monst1((i-20));
break;
case 22:
monst2((i-20));
break;
case 23:
monst3((i-20));
break;
default:
monst4((i-20));
break;
}
}
refresh();
}
/*
* right1-right9 are partial monster routines, for moving him off to
* the right of the screen. monst4 prints the whole pacman.
*/
right1(); monst4(50); refresh();
right2(); monst4(51); refresh();
right3(); monst4(52); refresh();
right4(); monst4(53); refresh();
right5(); monst4(54); refresh();
right6(); monst4(55); refresh();
right7(); monst4(56); refresh();
right8(); monst4(57); refresh();
right9(); monst4(58); refresh();
/* Now finish moving the pacman to the end of the screen. */
for (i=59; i
<HR>
This Usenet Oldnews Archive
article may be copied and distributed freely, provided:
<P>
1. There is no money collected for the text(s) of the articles.
<BR>
2. The following notice remains appended to each copy:
<P>
<EM>The Usenet Oldnews Archive: Compilation Copyright© 1981, 1996
<BR> Bruce Jones, Henry Spencer, David Wiseman.</EM>
<P>
<HR>
Goto <A HREF="82.04.04_ucbarpa.1049_net.sources.html">NEXT</A> article in NET.sources Newsgroup
<BR>Return to <A HREF="NET.sources-index.html">NET.sources index</A>
<BR>Return to the
<A HREF="../index.html">Usenet Oldnews Archive index</A>
</HTML>
-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <
[email protected]>
of
http://communication.ucsd.edu/A-News/
This Usenet Oldnews Archive
article may be copied and distributed freely, provided:
1. There is no money collected for the text(s) of the articles.
2. The following notice remains appended to each copy:
The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.