_TITLE "1 Jump - 2 Player Checkers - by Ken G." DIM black2
(88), red2
(88), bking
(88), rking
(88)
'Make checkerboard
LINE (149, 49)-(651, 551), _RGB32(255, 255, 255), B
LINE (lx
- 62.5, ly
)-(lx
, ly
+ 62.5), _RGB32(255, 0, 0), BF
LINE (lx
, ly
+ 62.5)-(lx
+ 62.5, ly
+ 125), _RGB32(255, 0, 0), BF
LINE (lx
- 62.5, ly
)-(lx
, ly
+ 62.5), _RGB32(0, 0, 0), BF
LINE (lx
, ly
+ 62.5)-(lx
+ 62.5, ly
+ 125), _RGB32(0, 0, 0), BF
h = h + 1
v = v + 1
h = 0: v = 0
h = h + 1
v = v + 1
'setup pieces
'black
ly = 50
'red
ly = 206.25
'The coordinate variables use a 2 digit number, the first digit is the horizon, the second is the vertical.
black2(1) = 12
black2(2) = 14
black2(3) = 16
black2(4) = 18
black2(5) = 21
black2(6) = 23
black2(7) = 25
black2(8) = 27
black2(9) = 32
black2(10) = 34
black2(11) = 36
black2(12) = 38
red2(9) = 81
red2(10) = 83
red2(11) = 85
red2(12) = 87
red2(5) = 72
red2(6) = 74
red2(7) = 76
red2(8) = 78
red2(1) = 61
red2(2) = 63
red2(3) = 65
red2(4) = 67
'----------------------------------------------------------------------------
'Main Loop
'Player One
one:
sp$ = ph$ + pv$
'Player Two
two:
sp3$ = ph3$ + pv3$
IF black2
(check2
) = sp3
THEN ch2
= sp3:
GOTO move2:
'----------------------------------------------------------------------------
move:
sp2$ = ph2$ + pv2$
'Check for red squares.
IF sp2
= 11 OR sp2
= 13 OR sp2
= 15 OR sp2
= 17 OR sp2
= 22 OR sp2
= 24 OR sp2
= 26 OR sp2
= 28 THEN IF sp2
= 31 OR sp2
= 33 OR sp2
= 35 OR sp2
= 37 OR sp2
= 42 OR sp2
= 44 OR sp2
= 46 OR sp2
= 48 THEN IF sp2
= 51 OR sp2
= 53 OR sp2
= 55 OR sp2
= 57 OR sp2
= 62 OR sp2
= 64 OR sp2
= 66 OR sp2
= 68 THEN IF sp2
= 71 OR sp2
= 73 OR sp2
= 75 OR sp2
= 77 OR sp2
= 82 OR sp2
= 84 OR sp2
= 86 OR sp2
= 88 THEN
red2(ch) = sp2
'Draw player one checker in the new square.
'First erase the old checker.
'Now draw the new checker.
'Check for a jump.
yy = y1
yy = yy + stp2
nex:
'Check for a King.
k1 = k1 + 1
rking(k1) = red2(ch)
'Check for a win.
nex3:
'-----------------------------------------------------------------------------------------------------------
'Player Two
move2:
sp4$ = ph4$ + pv4$
'Check for red squares.
IF sp4
= 11 OR sp4
= 13 OR sp4
= 15 OR sp4
= 17 OR sp4
= 22 OR sp4
= 24 OR sp4
= 26 OR sp4
= 28 THEN IF sp4
= 31 OR sp4
= 33 OR sp4
= 35 OR sp4
= 37 OR sp4
= 42 OR sp4
= 44 OR sp4
= 46 OR sp4
= 48 THEN IF sp4
= 51 OR sp4
= 53 OR sp4
= 55 OR sp4
= 57 OR sp4
= 62 OR sp4
= 64 OR sp4
= 66 OR sp4
= 68 THEN IF sp4
= 71 OR sp4
= 73 OR sp4
= 75 OR sp4
= 77 OR sp4
= 82 OR sp4
= 84 OR sp4
= 86 OR sp4
= 88 THEN
black2(ch2) = sp4
'Draw player two checker in the new square.
'First erase the old checker.
'Now draw the new checker.
'Check for a jump.
yy = y1
yy = yy + stp2
nex2:
'Check for a King.
k2 = k2 + 1
bking(k2) = black2(ch2)
'Check for a win.
nex4:
'Go back to Player One
'Draw the king symbol on the piece.
drawking:
LINE (x2
- 10, y2
+ 10)-(x2
+ 10, y2
+ 10), _RGB32(255, 255, 255) LINE (x2
- 10, y2
+ 7)-(x2
+ 10, y2
+ 7), _RGB32(255, 255, 255) LINE (x2
- 10, y2
+ 7)-(x2
- 15, y2
- 2), _RGB32(255, 255, 255) LINE (x2
- 15, y2
- 2)-(x2
- 5, y2
), _RGB32(255, 255, 255) LINE (x2
- 5, y2
)-(x2
, y2
- 4), _RGB32(255, 255, 255) LINE (x2
+ 10, y2
+ 7)-(x2
+ 15, y2
- 2), _RGB32(255, 255, 255) LINE (x2
+ 15, y2
- 2)-(x2
+ 5, y2
), _RGB32(255, 255, 255) LINE (x2
+ 5, y2
)-(x2
, y2
- 4), _RGB32(255, 255, 255)