fix(games): single playfield border, snake score in top strip, no soft-drop scoring, 239x295 window

This commit is contained in:
Luxferre
2026-10-23 16:07:35 +03:00
parent 1dd9fac313
commit bf4652ca5b
6 changed files with 13 additions and 22 deletions
+4 -9
View File
@@ -23,8 +23,8 @@
#include <X11/keysym.h>
#include <X11/Xatom.h>
static const int WIN_W = 240;
static const int WIN_H = 296;
static const int WIN_W = 239;
static const int WIN_H = 295;
static const int PCOLS = 10;
static const int PROWS = 20;
static const int CELL = 14;
@@ -255,15 +255,10 @@ static void render() {
XSetForeground(dpy, gc, C_BG);
XFillRectangle(dpy, back, gc, 0, 0, winW, winH);
// playfield border
// playfield border (single clean frame around the well)
XSetForeground(dpy, gc, C_DIM);
XDrawRectangle(dpy, back, gc, px0 - 1, py0 - 1, PCOLS * CELL + 2, PROWS * CELL + 2);
// frame the whole window (right/bottom edges too)
XSetForeground(dpy, gc, C_DIM);
XDrawRectangle(dpy, back, gc, 2, 2, winW - 4, winH - 4);
XDrawRectangle(dpy, back, gc, 3, 3, winW - 6, winH - 6);
// settled blocks
for (int x = 0; x < PCOLS; x++)
for (int y = 0; y < PROWS; y++)
@@ -381,7 +376,7 @@ static void handle_key(KeySym ks) {
int cells[4][2];
piece_cells(curType, curRot, cells);
if (!collide(curX, curY + 1, cells)) {
curY++; score += 1; if (score > best) best = score;
curY++;
} else {
lock_piece();
}