[nexuiz-commits] r7412 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Aug 9 13:47:18 EDT 2009


Author: div0
Date: 2009-08-09 13:47:18 -0400 (Sun, 09 Aug 2009)
New Revision: 7412

Modified:
   trunk/data/qcsrc/server/g_tetris.qc
Log:
make tetris easier to play (better tiles)


Modified: trunk/data/qcsrc/server/g_tetris.qc
===================================================================
--- trunk/data/qcsrc/server/g_tetris.qc	2009-08-09 12:53:59 UTC (rev 7411)
+++ trunk/data/qcsrc/server/g_tetris.qc	2009-08-09 17:47:18 UTC (rev 7412)
@@ -29,7 +29,7 @@
 float TET_WIDTH = 10;
 //character values
 float TET_BORDER = 139;
-float TET_BLOCKS = 132; // +1 = first color, +2, +3;
+float TET_BLOCK = 133;
 float TET_SPACE = 160; // blankness
 
 
@@ -381,10 +381,16 @@
 	{
 		d = GetSquare(x, ln);
 		if (d)
-			WriteChar(MSG_ONE, TET_BLOCKS + d);
+		{
+			WriteChar(MSG_ONE, '^');
+			WriteChar(MSG_ONE, d * d - 2 * d + 50); // 1, 2, 5
+			WriteChar(MSG_ONE, TET_BLOCK);
+		}
 		else
 			WriteChar(MSG_ONE, TET_SPACE);
 	}
+	WriteChar(MSG_ONE, '^');
+	WriteChar(MSG_ONE, '7');
 	WriteChar(MSG_ONE, TET_BORDER);
 }
 
@@ -392,9 +398,7 @@
 {
 	float x, d, piece_ln, pcolor;
 	vector piece_dat;
-	pcolor = pc & 3;
-	if (pcolor == 0) // 4
-		pcolor = 1;
+	pcolor = mod(pc, 3) + 1;
 	WriteChar(MSG_ONE, TET_SPACE); // pad to 6
 
 	piece_dat = PieceShape(pc);
@@ -406,7 +410,11 @@
 	{
 		d = GetXBlock(x, piece_ln) * pcolor;
 		if (d)
-			WriteChar(MSG_ONE, TET_BLOCKS + d);
+		{
+			WriteChar(MSG_ONE, '^');
+			WriteChar(MSG_ONE, d * d - 2 * d + 50); // 1, 2, 5
+			WriteChar(MSG_ONE, TET_BLOCK);
+		}
 		else
 			WriteChar(MSG_ONE, TET_SPACE);
 	}
@@ -600,9 +608,7 @@
 	orgx = orgx - 1;
 	orgy = orgy - 1;
 
-	pcolor = piece & 3;
-	if (pcolor == 0) // 4
-		pcolor = 1;
+	pcolor = mod(piece, 3) + 1;
 
 	for (y = 1; y < 5; y = y + 1)
 	{
@@ -829,7 +835,7 @@
 
 void TetrisImpulse()
 {
-	if(self.tetris_on != 1 && self.tetris_on != 3)
+	if(self.tetris_on == 0 || self.tetris_on == 2) // from "off" or "game over"
 	{
 		self.tetris_on = 3;
 
@@ -851,7 +857,7 @@
 		self.tet_org = self.origin;
 		self.movetype = MOVETYPE_NOCLIP;
 	}
-	else
+	else if(self.tetris_on == 1) // from "on"
 	{
 		Tet_GameExit();
 		self.impulse = 0;



More information about the nexuiz-commits mailing list