[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pbmserv-dev] gamerz.php



On Mon, 25 Jul 2005, Paul van Wamelen wrote:
> > Since I'm still shooting at a black box, I decided to start a game from
> > scratch.  Following some of the examples, I now have a XiangQi board
> > displaying using the CSS stuff.  Still need to work on the clicking part.
>
> Great! Look at how Jungle does the clicking (at the lsu site)

Thanks, that was a helpful example.

I have XiangQi clicking and moving now.  Still need to figure out how to
rotate the board.

> No, but if stuff is going to start coming in from different contributors
> then we have to be carefull of not overwriting each other. If you make no
> changes to the base files it shouldn't be a problem though...

I won't change the base files without checking with you.

But here's a suggestion:

--- cssboards.php       2005/07/26 06:16:59     1.1
+++ cssboards.php       2005/07/26 06:38:50
@@ -97,13 +97,13 @@
     for($i = 0; $i < $xdim; $i++){
       $A = substr($output[$yAoff+$j*$yAinc],$xAoff+$i*$xAinc,$num);
       if(isset($trans[$A])){
-        $xG = $xGoff+$i*$xGinc;
-        $yG = $yGoff+$j*$yGinc;
+        $xPos = $xGoff+$i*$xGinc;
+        $yPos = $yGoff+$j*$yGinc;
         echo "<img src=\"{$Gbase}{$trans[$A]}$Gext\" border=0";
         if($clickable){
           echo " onClick=\"PieceClick($i,$j,'{$trans[$A]}')\"";
         }
-        echo " STYLE=\"position:absolute;top:{$yG}px;left:{$xG}px\">\n";
+        echo " STYLE=\"position:absolute;top:{$yPos}px;left:{$xPos}px;height:{$yG}px;width:{$xG}px\">\n";
       }
     }
   }


The $xG and $yG parameters to ReadAndShowCSSBoard are not being used.
This patch uses them for the size of the pieces, so I can specify the size
of the pieces as well as the board background ($xG and $yG for
BeginCSSBoard).  Will this break any existing games?  One would have to
pass the real size or 'auto' to get the existing behavior.

Hmm... Looks like all the currently installed games are using
ReadAndShowHexCSSBoard, so maybe there is no conflicts?

~ John Williams