KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Volunteers wanted, Project KiXChess
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    KiXforms Forum Index -> Fun & Games
View previous topic :: View next topic  
Author Message
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Thu Mar 06, 2003 3:07 pm    Post subject: Reply with quote

Code:
break on

; Project KiXChess written by
;
;   Christopher Shilt, Jochen Polster
;
; Artwork, Contributors, Coffee logistics, etc.
;
;   Rodney Clarke, our Wifes and Girlfriends
;
; 03/05/2003 - Today

$bitwise = not 1

$form                 = createobject("KiXtart.Form")
$form.Caption         = "KiXChess"
$form.ClientWidth     = 520
$form.ClientHeight    = 470

$picBoard             = $form.PictureBox
$picBoard.Location    = 20,20
$picBoard.Size        = 409,409
$picBoard.BorderStyle = 0
$picBoard.BackColor   = Black

dim $xC, $yC
for $x = 1 to 351 step 50
    for $y = 1 to 351 step 50
        $xC=$x/50 $yC=$y/50
        $ = execute("$$btnField_$xC$yC = $$picBoard.ToolButton('',"+($x+$xC)+","+($y+$yC)+",50,50)")
        $ = execute("$$btnField_$xC$yC.FlatStyle=1")
        $ = execute("$$btnField_$xC$yC.FontName='Chess Cases'")
        $ = execute("$$btnField_$xC$yC.FontSize=36")
        $ = execute("if $$bitwise $$btnField_$xC$yC.BackColor=KiXtart else $$btnField_$xC$yC.BackColor=White endif ")
        $bitwise = not $bitwise
    next
    $bitwise = not $bitwise
next

$ = ResetBoard()
$form.Center
$form.Show

while $form.Visible
   $ = execute($form.DoEvents)
loop

;=============================================================================================
;                                  ---  Functions  ---
;=============================================================================================

;------------------------------
;       - The Board -
;------------------------------

function ResetBoard()
    dim $x, $y
    $picBoard.BeginUpdate
    for $x = 0 to 7
        for $y = 0 to 7
            select
                case $y = 0
                    select
                        case $x=0 or $x=7 $ = execute("$$btnField_$x$y.Caption='t'")
                        case $x=1 or $x=6 $ = execute("$$btnField_$x$y.Caption='m'")
                        case $x=2 or $x=5 $ = execute("$$btnField_$x$y.Caption='v'")
                        case $x=3         $ = execute("$$btnField_$x$y.Caption='w'")
                        case $x=4         $ = execute("$$btnField_$x$y.Caption='l'")
                    endselect
                case $y = 1 $ = execute("$$btnField_$x$y.Caption='o'")
                case $y = 6 $ = execute("$$btnField_$x$y.Caption='p'")
                case $y = 7
                    select
                        case $x=0 or $x=7 $ = execute("$$btnField_$x$y.Caption='r'")
                        case $x=1 or $x=6 $ = execute("$$btnField_$x$y.Caption='n'")
                        case $x=2 or $x=5 $ = execute("$$btnField_$x$y.Caption='b'")
                        case $x=3         $ = execute("$$btnField_$x$y.Caption='q'")
                        case $x=4         $ = execute("$$btnField_$x$y.Caption='k'")
                    endselect
                case 1      $ = execute("$$btnField_$x$y.Caption=''")
            endselect
        next
    next
    $picBoard.EndUpdate
endfunction


This is hopefully the correct layout for figures(My last chess match was a bit ago) ... The font used here is CHESSCASE.ttf to be found here .
The font has to be 'installed' on the local system first (maybe we should code an install routine later on ?)

Caution : The Font will be replaced later by an adapted version (If Rod had the time)

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.


Last edited by Jochen on Thu Mar 06, 2003 8:00 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
Chris S.
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 241

PostPosted: Thu Mar 06, 2003 6:44 pm    Post subject: Reply with quote

Tee hee. Jochen, it has been a while since you've played hasn't it? I think the Queen and King are transposed. Wink
Back to top
View user's profile Send private message MSN Messenger
Chris S.
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 241

PostPosted: Thu Mar 06, 2003 7:10 pm    Post subject: Reply with quote

I have some icons done...

Screenshot & Icons:
http://www.geocities.com/gk_zone/chessboard.htm
Back to top
View user's profile Send private message MSN Messenger
Chris S.
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 241

PostPosted: Thu Mar 06, 2003 7:35 pm    Post subject: Reply with quote

BTW, I can compile the icons into an exe and we can use this to create imagelists. When done we'll have around 30 different chess sets to choose from.
Back to top
View user's profile Send private message MSN Messenger
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Thu Mar 06, 2003 8:06 pm    Post subject: Reply with quote

Damnit !

I knew that'd happen Embarassed

Always need to visualize the 'Matt in 4 moves' play to know that the white queen is always on a white field

(Updated code above !)

Well ... as for the Icon library : Go for it ! (Maybe easier to distribute than fonts)

We will see which strategy applies better ... speaking of redraw speed Wink

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
jim
KiXforms Supporter
KiXforms Supporter


Joined: 05 Mar 2003
Posts: 76
Location: Philadelphia, PA

PostPosted: Thu Mar 06, 2003 11:32 pm    Post subject: Basic rules Reply with quote

To simplify the layout:

"White to the right" - white square always on the bottom right rank and file.

"Queen on her color" - The queen always occupies her own color on setup

Back to top
View user's profile Send private message
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Fri Mar 07, 2003 7:13 am    Post subject: Reply with quote

Jim,

welcome and thanks for verfiying the layout Smile
Now that things are cleared on with the movement and controls.
Will see what I can dabble over the wekeend (Oh heck, I am a 'follower' in the mean time Cool )
Any interest in helping to develop the AI for Computer player ?

Approximately (If time allows) we can start that at the end of march

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
jim
KiXforms Supporter
KiXforms Supporter


Joined: 05 Mar 2003
Posts: 76
Location: Philadelphia, PA

PostPosted: Fri Mar 07, 2003 4:46 pm    Post subject: Reply with quote

That task seems monumental in scope but no doubt would be a great learning experience as I have very little formal programming education. I'd like to help but my time is limited. Maybe if you throw some smaller tasks my way I could contribute in that manner?
Back to top
View user's profile Send private message
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Fri Mar 07, 2003 9:25 pm    Post subject: Reply with quote

Why not implement a complete set of 'skins' for the chess board. Instead of just having different icon libraries, include other stuff, too, like borders, the chess surface itself,...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Rod
KiXforms Webmaster
KiXforms Webmaster


Joined: 22 Feb 2003
Posts: 202
Location: United Kingdom

PostPosted: Sat Mar 08, 2003 10:29 am    Post subject: Reply with quote

Well it looks like Chris well and truly beat me to it in producing the chess piece graphics. If you need any additional help then feel free to call. BTW, at this rate Jochen you won’t be a KiXforms Follower for long. Wink

Rod.

_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Sat Mar 08, 2003 8:36 pm    Post subject: Reply with quote

Hmmmm .....

Jim, it will be indeed a monumental task implementing AI for Computer player, but I predict great fun and coffee consumption Very Happy

Jens, yeah ... Skins are wonderful , skins are my friends but there are (still) some limits in KiXforms regarding graphics support

Rod, I still think that there are great speed advantages in using fonts (and currently develop more in font direction than in Icons, which is easy to change, don't get me wrong!) soooo .... I'd be pleased to have the ammended fonts Wink

cya on Monday

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
Chris S.
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 241

PostPosted: Sat Mar 08, 2003 8:54 pm    Post subject: Reply with quote

I have it on good authority that there will be added support for icons soon. By that I mean exe/dll support for ImageLists.Add method.
Back to top
View user's profile Send private message MSN Messenger
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Sat Mar 08, 2003 10:21 pm    Post subject: Reply with quote

That mean if I read that correctly I can finally use cards.dll ?

Twisted Evil Cool Very Happy

Great thing !

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Sat Mar 08, 2003 10:24 pm    Post subject: Reply with quote

All I need then (needed that anyway for some time now) are the ImageList as seperate/independant Control Smile
_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
Rod
KiXforms Webmaster
KiXforms Webmaster


Joined: 22 Feb 2003
Posts: 202
Location: United Kingdom

PostPosted: Sun Mar 09, 2003 2:50 pm    Post subject: Reply with quote

jpols wrote:
Rod, I still think that there are great speed advantages in using fonts (and currently develop more in font direction than in Icons, which is easy to change, don't get me wrong!) soooo .... I'd be pleased to have the ammended fonts


Sorry Jochen, I only have software that can manipulate graphics, not fonts. Confused

Rod.

_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Fun & Games All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group