File tree Expand file tree Collapse file tree 6 files changed +136
-3
lines changed
Expand file tree Collapse file tree 6 files changed +136
-3
lines changed Original file line number Diff line number Diff line change 1- from kivy . app import App
1+
22from kivy .uix .screenmanager import Screen
33from kivy .config import Config
44from kivy .core .window import Window
5+ from kivy .factory import Factory
6+ from kivy .uix .gridlayout import GridLayout
7+ from kivy .lang import Builder
8+ from kivy .uix .button import Button
9+ from kivy .app import App
10+ from kivy .uix .gridlayout import GridLayout
11+
12+
513
614
715class main_window (Screen ):
816 pass
917
18+
1019class filename (App ):
1120 def build (self ):
21+ app = App .get_running_app ()
1222 return main_window ()
1323
1424
1525
1626if __name__ == "__main__" :
17- width_of_board = 800
27+ width_of_board = 820
1828 height_of_board = 800
29+
1930 #Set the Hight and Width of the App
2031 Config .set ('graphics' , 'width' , str (width_of_board ))
2132 Config .set ('graphics' , 'height' , str (height_of_board ))
2233
2334 #Make the App non-resizable
2435 Config .set ('graphics' , 'resizable' , '0' )
2536 Config .write ()
37+
2638 #Make the top windows bar go away
27- # Window.borderless = True
39+ Window .borderless = True
2840 filename ().run ()
Original file line number Diff line number Diff line change 11# File name: Board.py
2+ # include force pieces.kv
23
34<main_window>
5+ id : main_window
46 canvas.before:
57 Rectangle:
68 pos: self .pos
Original file line number Diff line number Diff line change 1+ from kivy .app import App
2+
3+
4+
5+
6+
7+ '''
8+ TODO LIST
9+
10+ 1. FIGURE OUT CODE ARCHITECTURE (HARD)
11+ 2. DISPLAY THE PIECES AND MAKE IT LOOK SEEMLESS (easy when code arch. is finished)
12+ 2.5 CODE A DRAGGING SYSTEM AND A TOUCH-BASED SYSTEM
13+ 2.75 MAKE THE DRAGGING SYSTEM HAVE THE PIECES MOVE A LAYER UP FROM THE BOARD
14+ 3. CODE ALL OF THE MOVES FOR THE PIECES (HARD; MAKE CODE STILL NEAT)
15+ 4. CREATE A SYSTEM OF TURN-BASED GAMEPLAY (MEDIUM; NEED TO KEEP CODE CLEAN)
16+ 5. CREATE A SYSTEM TO SHOW THE USER WHERE TO PLACE: AND A CHECK-BASED SYSTEM
17+ 6. CREATE A SYSTEM FOR KILLING OTHER PIECES
18+
19+ DONE;
20+ THE GAMEPLAY SHOULD BE BASICALLY DONE
21+
22+ '''
Original file line number Diff line number Diff line change 1+ # File name: pieces.py
2+
3+ <white_pieces>
4+
5+ #ALL OF THE 'REGULAR' PIECES:
6+
7+ Button:
8+ id : " Left White Rook"
9+ text: " Left White Rook"
10+ pos: 0 ,0
11+ Button:
12+ id : " Right White Rook"
13+ text: " Right White Rook"
14+ pos: 720 ,0
15+ Button:
16+ id : " Left White Knight"
17+ text: " Left White Knight"
18+ pos: 100 ,0
19+ Button:
20+ id : " Right White Knight"
21+ text: " Right White Knight"
22+ pos: 620 ,0
23+ Button:
24+ id : " Left White Bishop"
25+ text: " Left White Bishop"
26+ pos: 200 ,300
27+ background_normal: ' black_Bishop.png'
28+ background_down: ' black_Bishop.png'
29+ on_press: root.yes()
30+ on_release: root.no()
31+ Button:
32+ id : " Right White Bishop"
33+ text: " Right White Bishop"
34+ pos: 520 ,0
35+ background_color: 0 ,0 ,0 ,0
36+ Button:
37+ id : " White King"
38+ text: " White King"
39+ pos: 300 ,0
40+ Button:
41+ id : " White Queen"
42+ text: " White Queen"
43+ pos: 410 , 0
44+ #ALL OF THE PAWNS:
45+
46+ Button:
47+ id : " Pawn1"
48+ text: " Pawn1"
49+ pos: 20 ,100
50+ Button:
51+ id : " Pawn2"
52+ text: " Pawn2"
53+ pos: 120 ,100
54+ Button:
55+ id : " Pawn3"
56+ text: " Pawn3"
57+ pos: 220 ,100
58+ Button:
59+ id : " Pawn4"
60+ text: " Pawn4"
61+ pos: 320 ,100
62+ Button:
63+ id : " Pawn5"
64+ text: " Pawn5"
65+ pos: 420 ,100
66+ Button:
67+ id : " Pawn6"
68+ text: " Pawn6"
69+ pos: 520 ,100
70+ Button:
71+ id : " Pawn7"
72+ text: " Pawn7"
73+ pos: 620 ,100
74+
75+ Button:
76+ id : " Pawn8"
77+ text: " Pawn8"
78+ pos: 720 ,100
Original file line number Diff line number Diff line change 1+ from kivy .uix .button import Button
2+ from kivy .app import App
3+ from kivy .uix .gridlayout import GridLayout
4+ from kivy .uix .behaviors import ButtonBehavior
5+ from kivy .uix .image import Image
6+
7+
8+
9+ class white_pieces (Button , Image ):
10+ def yes (self ):
11+ print ("CLICK" )
12+ def no (self ):
13+ print ("NOPE" )
14+
15+ class pieces (App ):
16+ def build (self ):
17+ return white_pieces ()
18+
19+ pieces ().run ()
You can’t perform that action at this time.
0 commit comments