shithub: plan9front

Download patch

ref: 74befadb1457ccb955d2dfa3c9fb44653e4986f9
parent: 295acd7e0d711cfd2c7c6a1bd45d00c9727f5786
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Apr 2 16:05:15 EDT 2021

games/glendy: don't use lucida sans in menus by default and bugfix (thanks kemal)

i have found one bug. when i put glenda in a position like this

i somehow win, but the glenda can escape from there.

in addition, i have changed the games manpage to include more info about glendy.

--- a/sys/man/1/games	Fri Apr  2 14:23:25 2021
+++ b/sys/man/1/games	Fri Apr  2 16:05:15 2021
@@ -200,7 +200,9 @@
 add gibberish diagrams, equations and tables.
 .TP
 .B glendy
-Don't let the rabbit escape.
+Don't let the rabbit escape. Button 2 presents a menu that you
+can set the difficulty level from. Button 3 presents a menu
+that you can either play a new game, reset the game or exit.
 .TP
 .B juggle
 Display the juggling
--- a/sys/src/games/glendy.c	Fri Apr  2 14:23:25 2021
+++ b/sys/src/games/glendy.c	Fri Apr  2 16:05:15 2021
@@ -386,7 +386,7 @@
 			nextdir = (nrand(++count) == 0)?dir:nextdir;
 		}
 	}
-	if(min < 100)
+	if(min <= 100)
 		domove(nextdir, p.x, p.y);
 	else
 		finished = Won;
@@ -459,7 +459,6 @@
 	Mouse m;
 	Event ev;
 	int e, mousedown=0;
-	char *fontname;
 
 	USED(argv, argc);
 
@@ -474,10 +473,6 @@
 	allocimages();
 	initlevel();	/* must happen before "eresized" */
 	eresized(0);
-
-	fontname = "/lib/font/bit/lucidasans/unicode.8.font";
-	if((font = openfont(display, fontname)) == nil)
-		sysfatal("font '%s' not found", fontname);	
 
 	for(;;) {
 		e = event(&ev);