9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] games/glendy: don't use lucida sans in menus by default
@ 2021-04-02 18:34 kemal
  2021-04-02 19:29 ` [9front] " kemal
  0 siblings, 1 reply; 7+ messages in thread
From: kemal @ 2021-04-02 18:34 UTC (permalink / raw)
  To: 9front

why can't i use vga? uncool.

diff -r cc26fdf57bb2 sys/src/games/glendy.c
--- a/sys/src/games/glendy.c	Sat Mar 13 14:57:53 2021 +0100
+++ b/sys/src/games/glendy.c	Fri Apr 02 21:33:18 2021 +0300
@@ -473,11 +473,7 @@

 	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);
+	eresized(0);

 	for(;;) {
 		e = event(&ev);



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [9front] Re: games/glendy: don't use lucida sans in menus by default
  2021-04-02 18:34 [9front] games/glendy: don't use lucida sans in menus by default kemal
@ 2021-04-02 19:29 ` kemal
  2021-04-02 19:51   ` kemal
  2021-04-02 20:05   ` cinap_lenrek
  0 siblings, 2 replies; 7+ messages in thread
From: kemal @ 2021-04-02 19:29 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]

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

(see attachment, excuse my excellent screenshot skills :D. i need
to play a lot)

i somehow win, but the glenda can escape from there. diff renewed
to fix that bug. in addition, i have changed the games manpage
to include more info about glendy.

diff -r cc26fdf57bb2 sys/man/1/games
--- a/sys/man/1/games	Sat Mar 13 14:57:53 2021 +0100
+++ b/sys/man/1/games	Fri Apr 02 22:29:07 2021 +0300
@@ -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
diff -r cc26fdf57bb2 sys/src/games/glendy.c
--- a/sys/src/games/glendy.c	Sat Mar 13 14:57:53 2021 +0100
+++ b/sys/src/games/glendy.c	Fri Apr 02 22:29:07 2021 +0300
@@ -386,11 +386,10 @@
 			nextdir = (nrand(++count) == 0)?dir:nextdir;
 		}
 	}
-	if(min < 100)
+	if(min <= 100)
 		domove(nextdir, p.x, p.y);
-	else
+	else
 		finished = Won;
-
 	if(eqpt(findglenda(), Pt(-1, -1)))
 		finished = Lost;
 }
@@ -473,11 +472,7 @@

 	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);
+	eresized(0);

 	for(;;) {
 		e = event(&ev);

[-- Attachment #2: unknown.png --]
[-- Type: image/png, Size: 2855 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [9front] Re: games/glendy: don't use lucida sans in menus by default
  2021-04-02 19:29 ` [9front] " kemal
@ 2021-04-02 19:51   ` kemal
  2021-04-02 19:56     ` kemal
  2021-04-02 20:05   ` cinap_lenrek
  1 sibling, 1 reply; 7+ messages in thread
From: kemal @ 2021-04-02 19:51 UTC (permalink / raw)
  To: 9front

oh, one more thing. menu button names have their first letter
usually capitalized, i think this should be like that too.

diff -r cc26fdf57bb2 sys/man/1/games
--- a/sys/man/1/games	Sat Mar 13 14:57:53 2021 +0100
+++ b/sys/man/1/games	Fri Apr 02 22:48:39 2021 +0300
@@ -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
diff -r cc26fdf57bb2 sys/src/games/glendy.c
--- a/sys/src/games/glendy.c	Sat Mar 13 14:57:53 2021 +0100
+++ b/sys/src/games/glendy.c	Fri Apr 02 22:48:39 2021 +0300
@@ -45,17 +45,17 @@

 char *mbuttons[] =
 {
-	"easy",
-	"medium",
-	"hard",
+	"Easy",
+	"Medium",
+	"Hard",
 	0
 };

 char *rbuttons[] =
 {
-	"new",
-	"reset",
-	"exit",
+	"New",
+	"Reset",
+	"Exit",
 	0
 };

@@ -386,11 +386,10 @@
 			nextdir = (nrand(++count) == 0)?dir:nextdir;
 		}
 	}
-	if(min < 100)
+	if(min <= 100)
 		domove(nextdir, p.x, p.y);
-	else
+	else
 		finished = Won;
-
 	if(eqpt(findglenda(), Pt(-1, -1)))
 		finished = Lost;
 }
@@ -473,11 +472,7 @@

 	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);
+	eresized(0);

 	for(;;) {
 		e = event(&ev);



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [9front] Re: games/glendy: don't use lucida sans in menus by default
  2021-04-02 19:51   ` kemal
@ 2021-04-02 19:56     ` kemal
  2021-04-02 20:07       ` kemal
  0 siblings, 1 reply; 7+ messages in thread
From: kemal @ 2021-04-02 19:56 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 139 bytes --]

(i hope i am not sending too much mails for a game like this...)
ok sorry, at first i thought bug got fixed but the problem
persists.


[-- Attachment #2: unknown.png --]
[-- Type: image/png, Size: 5961 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9front] Re: games/glendy: don't use lucida sans in menus by default
  2021-04-02 19:29 ` [9front] " kemal
  2021-04-02 19:51   ` kemal
@ 2021-04-02 20:05   ` cinap_lenrek
  1 sibling, 0 replies; 7+ messages in thread
From: cinap_lenrek @ 2021-04-02 20:05 UTC (permalink / raw)
  To: 9front

applied.

--
cinap

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [9front] Re: games/glendy: don't use lucida sans in menus by default
  2021-04-02 19:56     ` kemal
@ 2021-04-02 20:07       ` kemal
  2021-04-02 20:20         ` cinap_lenrek
  0 siblings, 1 reply; 7+ messages in thread
From: kemal @ 2021-04-02 20:07 UTC (permalink / raw)
  To: 9front

(so sorry for disturbing the ml with **5** mails)

ok this one seems to fix the bug.

diff -r cc26fdf57bb2 sys/man/1/games
--- a/sys/man/1/games	Sat Mar 13 14:57:53 2021 +0100
+++ b/sys/man/1/games	Fri Apr 02 23:05:01 2021 +0300
@@ -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
diff -r cc26fdf57bb2 sys/src/games/glendy.c
--- a/sys/src/games/glendy.c	Sat Mar 13 14:57:53 2021 +0100
+++ b/sys/src/games/glendy.c	Fri Apr 02 23:05:01 2021 +0300
@@ -45,17 +45,17 @@

 char *mbuttons[] =
 {
-	"easy",
-	"medium",
-	"hard",
+	"Easy",
+	"Medium",
+	"Hard",
 	0
 };

 char *rbuttons[] =
 {
-	"new",
-	"reset",
-	"exit",
+	"New",
+	"Reset",
+	"Exit",
 	0
 };

@@ -386,11 +386,10 @@
 			nextdir = (nrand(++count) == 0)?dir:nextdir;
 		}
 	}
-	if(min < 100)
+	if(min < 100 || min == 999)
 		domove(nextdir, p.x, p.y);
 	else
 		finished = Won;
-
 	if(eqpt(findglenda(), Pt(-1, -1)))
 		finished = Lost;
 }
@@ -473,11 +472,7 @@

 	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);
+	eresized(0);

 	for(;;) {
 		e = event(&ev);

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9front] Re: games/glendy: don't use lucida sans in menus by default
  2021-04-02 20:07       ` kemal
@ 2021-04-02 20:20         ` cinap_lenrek
  0 siblings, 0 replies; 7+ messages in thread
From: cinap_lenrek @ 2021-04-02 20:20 UTC (permalink / raw)
  To: 9front

too late.

--
cinap

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-04-02 20:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-02 18:34 [9front] games/glendy: don't use lucida sans in menus by default kemal
2021-04-02 19:29 ` [9front] " kemal
2021-04-02 19:51   ` kemal
2021-04-02 19:56     ` kemal
2021-04-02 20:07       ` kemal
2021-04-02 20:20         ` cinap_lenrek
2021-04-02 20:05   ` cinap_lenrek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).