diff options
author | rodri <rgl@antares-labs.eu> | 2023-04-09 22:14:26 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2023-04-09 22:14:26 +0000 |
commit | 42ea627853d79a54ef956a831e2f8badff5bfdb8 (patch) | |
tree | 9401456fc574c5b14931f6b170327c5ebc7be3c9 | |
parent | b545537c9a6c7d32976b863cbb14792980d31e3d (diff) | |
download | musw-42ea627853d79a54ef956a831e2f8badff5bfdb8.tar.gz musw-42ea627853d79a54ef956a831e2f8badff5bfdb8.tar.bz2 musw-42ea627853d79a54ef956a831e2f8badff5bfdb8.zip |
added a new pulsar animation for the star sprite.
wrote a little description for the manpage.
generalized the drawconnecting() procedure into a drawprogressing() one that takes an arbitrary, nul-terminated string as input.
-rw-r--r-- | assets/spr/pulsar.pic | bin | 0 -> 9294 bytes | |||
-rw-r--r-- | musw.c | 13 | ||||
-rw-r--r-- | musw.man | 6 | ||||
-rw-r--r-- | muswd.c | 6 |
4 files changed, 14 insertions, 11 deletions
diff --git a/assets/spr/pulsar.pic b/assets/spr/pulsar.pic Binary files differnew file mode 100644 index 0000000..2444d31 --- /dev/null +++ b/assets/spr/pulsar.pic @@ -480,7 +480,7 @@ darkness: } void -drawconnecting(void) +drawprogressing(char *s) { static double t0; static Point p = {100,300}; @@ -491,11 +491,11 @@ drawconnecting(void) t0 = nanosec(); if(nanosec()-t0 >= 5e9){ /* every five seconds */ - p = Pt(ntruerand(SCRW-2*100)+100,ntruerand(SCRH-100)+100); + p = Pt(ntruerand(SCRW-stringwidth(font, s)-3*font->width),ntruerand(SCRH-font->height)); t0 = nanosec(); } - np = string(screenb, addpt(screenb->r.min, p), display->white, ZP, font, "connecting"); + np = string(screenb, addpt(screenb->r.min, p), display->white, ZP, font, s); for(i = 1; i < 3+1; i++){ if(nanosec()-t0 > i*1e9) @@ -518,9 +518,10 @@ redraw(void) intro->draw(intro, screenb, subpt(divpt(screenb->r.max, 2), divpt(intro->r.max, 2))); break; case GSConnecting: - drawconnecting(); + drawprogressing("connecting"); break; case GSMatching: + drawprogressing("waiting for players"); break; case GSPlaying: drawship(&universe->ships[0], screenb); @@ -548,8 +549,6 @@ resize(void) sysfatal("resize failed"); unlockdisplay(display); -// screenrf.p = Pt2(screen->r.min.x+Dx(screen->r)/2,screen->r.max.y-Dy(screen->r)/2,1); - /* ignore move events */ if(Dx(screen->r) != SCRW || Dy(screen->r) != SCRH){ fd = open("/dev/wctl", OWRITE); @@ -660,7 +659,7 @@ threadmain(int argc, char *argv[]) sysfatal("readvmodel: %r"); universe->ships[0].mdl = needlemdl; universe->ships[1].mdl = wedgemdl; - universe->star.spr = readsprite("assets/spr/earth.pic", ZP, Rect(0,0,32,32), 5, 20e3); + universe->star.spr = readsprite("assets/spr/pulsar.pic", ZP, Rect(0,0,64,64), 9, 50); intro = readsprite("assets/spr/intro.pic", ZP, Rect(0,0,640,480), 1, 0); @@ -4,7 +4,7 @@ musw, muswd \- multi-user spacewar! .SH SYNOPSIS .B games/musw [ -.B -d +.B -dg ] .I dialstring .br @@ -17,6 +17,10 @@ musw, muswd \- multi-user spacewar! .I addr ] .SH DESCRIPTION +.I Musw +is a multi-user, on-line version of +.IR Spacewar! , +the space dogfight simulation game developed by Steve Russell in the 1960s for the PDP-1. .SH EXAMPLE .SH SOURCE .B /sys/src/games/musw @@ -473,12 +473,12 @@ threadmain(int argc, char *argv[]) fmtinstall(L'Φ', Φfmt); addr = "udp!*!112"; ARGBEGIN{ - case 'a': - addr = EARGF(usage()); - break; case 'd': debug++; break; + case 'a': + addr = EARGF(usage()); + break; default: usage(); }ARGEND; |