How to Make Chess in Python!

How to Make Chess in Python!

LeMaster Tech

1 год назад

59,031 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Amey Hukkeri
Amey Hukkeri - 21.11.2023 10:04

Is there any way i can connect to you personally??

Ответить
Amey Hukkeri
Amey Hukkeri - 21.11.2023 10:02

You need recognition, and I'm gon do it for you!

Ответить
Xap95
Xap95 - 31.10.2023 14:22

hey I've just got to the selection part but it's not working. it for some reason is like going up on an angle so like when I click a piece it will be in the right row but it and the bottom rook and the second pawn are correct but all the others are just random should I just start over or do you know what is wrong

Ответить
Anthony Vela
Anthony Vela - 26.10.2023 22:23

how do you add the asset folder im new and im stuck on this part and need help

Ответить
HARSH SHAH
HARSH SHAH - 17.10.2023 11:32

Hi bro,really useful video
But I had a question:-
Does this code run on vscode in windows11 and if yess pls explain how
By the way an excellent tutorial from you
Thanks

Ответить
Protibadi Mon
Protibadi Mon - 17.10.2023 08:15

Can you make it online multiplayer game? I will pay you

Ответить
Anush V
Anush V - 15.10.2023 17:50

How do you flip the board after every turn?

Ответить
Anush V
Anush V - 14.10.2023 13:19

This is so cool! But do you know any way that i could flip the board so that it could be easier for the other player to play?

Ответить
Raiden
Raiden - 09.10.2023 10:37

Can this be used for a project for college?

Ответить
Alessandro Taranto
Alessandro Taranto - 03.10.2023 01:17

hi, how could i be able to access the position of the opposite king during the check_king? because i want to make it so that my king cannot move inside another kings range

Ответить
JAIVIK GAMER
JAIVIK GAMER - 21.09.2023 08:35

I think you should make it's shorter version 👽

Ответить
Joseph Johnson
Joseph Johnson - 12.09.2023 20:59

Very well done! very clear and the fact that you provided the github when some other videos for whatever reason did not, is a great plus! one note sometimes your camera square blocks what you are typing, maybe put it in the top left corner but other than that very well done! keep this up and I am sure you will have millions of subscribers and views!

Ответить
OShiso!
OShiso! - 09.09.2023 09:40

does anyone encounter that it doesn't draw the select pieces for you?

Ответить
Controller
Controller - 30.08.2023 13:18

thanks helped me get to know how to use pygame and how it works

Ответить
Taha Neji
Taha Neji - 29.08.2023 01:04

which version of python is this ?

Ответить
Bright Sіde
Bright Sіde - 26.08.2023 02:15

bro plays bongcloud - nice vid

Ответить
Shivam Kushwaha
Shivam Kushwaha - 25.08.2023 22:04

I'd like to have a pin function like- if a piece is in between my king and other check giving piece, then i should not be able to move that piece and yeah thanks teacher for the great project.

Ответить
Shivam Kushwaha
Shivam Kushwaha - 25.08.2023 15:53

Amazing guide bro, great work only problem was your cam area😅, you could've moved it on a different spot, I was waiting for you to scroll to write most of the time.

Ответить
Aidan O'Meara
Aidan O'Meara - 21.08.2023 22:56

This was fantastic, I just finished my game and everything works smoothly. Thanks for the great video!

Ответить
Aamaan Kafeel
Aamaan Kafeel - 20.08.2023 18:17

best video helped me a lot

Ответить
Vadapalli Preethi
Vadapalli Preethi - 18.08.2023 10:51

Your so good😊❤❤

Ответить
Varun Nayak
Varun Nayak - 15.08.2023 16:34

Could you please reply to this comment with the required code for castling, promotion and en passant ?

Ответить
PokeDeckDynasty
PokeDeckDynasty - 14.08.2023 11:56

i'll sub if you make a short follow up video on how to implement en passant, castling, and pawn promotion

Ответить
Varun Nayak
Varun Nayak - 13.08.2023 15:09

Thanks for this tutorial

Ответить
SweGBoy02
SweGBoy02 - 07.08.2023 18:12

I'm having an issue with the turn_step loop and piece selection/movement. I just finished the knight movement but this has been an issue since I made the pawns.

In short; it never seems to go around to turn_step 0, and the black pieces never move.

It starts with white's turn and I think they behave as they should, but once I then select black pieces and see the blue selection marker and valid moves, whenever I try to move any kind of piece to any possible spot, the white counterpart goes there instead. I try to play any pawn, 1 step or 2, the opposing white pawn gets placed there, and it's still black's turn to select a piece (turn_step 2). Try to move a knight and the mirrored white knight teleports right in front of my poor unsuspecting black pawns. Still black's turn. Select a black pawn to capture the knight and the opposite pawn moves 4 squares down and 1 to the side to land on top of the knight. Still black's turn.

turn_step goes: 0 1 2 3 2 3 2 3 but only white pieces move, so when it's black's turn the white pieces move with the black's valid moves. I cannot select or interact with the black pieces on white's turn.

So besides crossing the board, they're only making valid moves, aka only moving to squares with colored dots, so I'm guessing it's the turn_step cycle and the white/black_selections/locations lists or something, but I haven't got a clue where I went wrong.

Ответить
Víťa Skácel
Víťa Skácel - 02.08.2023 20:35

Great tutorial, I have always wanted to create a Chess geme.

Ответить
Abdellah TALBI
Abdellah TALBI - 30.07.2023 18:20

u forgot about en passant @Lemaster Tech

Ответить
Neptune
Neptune - 18.07.2023 18:39

When I run, it only displays a black screen with python doesn’t respond

Ответить
Augustine george
Augustine george - 09.07.2023 21:02

This really helped me. Thank you so much man

Ответить
Philip
Philip - 04.07.2023 17:57

I thought in python the cells were (row, column) with the top right being (0,0). But the white locations here are [(0, 0), (1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0), (7, 0) which would put the white pieces down the left side,

Ответить
seaworldwaters
seaworldwaters - 03.07.2023 03:04

hi, i'm up to the end of drawing valid moves on the screen but when i try to run the program it comes up with an error:
black_options = check_options(black_pieces, black_locations, 'black')
moves_list = check_rook(location, turn)
NameError: name 'check_rook' is not defined. Did you mean: 'black_rook'?

do you have any idea on what the problem is or how i can fix it (or if ive maybe missed anything)? thank you!

Ответить
D
D - 26.06.2023 22:28

ty really well done

Ответить
Milko Sirkyov
Milko Sirkyov - 25.06.2023 14:17

Very informative video. I tried to implement additional features and it was all going fine until en passant. Can you give me some advice?

Ответить
Renuka Varadi
Renuka Varadi - 23.06.2023 19:08

i got an error(their is no pygame module)☹

Ответить
Marc Mailly
Marc Mailly - 13.06.2023 22:32

Eddie Sharick have a function def loadImages() to load chess images in his main program : a global dictionary of images
images = {}
def loadImages():
pieces = ['wp', 'wN', 'wB', 'wR', 'wQ', 'wK', 'bp', 'bN', 'bB', 'bR', 'bQ', 'bK']
for piece in pieces:
images[piece] = pygame.transform.scale(pygame.image.load(f'assets/images/{piece}.png'), (size, size))
His variable size equals the board width divided by 8 (eclidian division)

Ответить
smanzoli
smanzoli - 13.06.2023 05:28

Board should also be a loaded image... nice video!

Ответить
Alfredo Brickz
Alfredo Brickz - 26.05.2023 15:32

where do i find my assets folder?

Ответить
Mmeso Iruma
Mmeso Iruma - 22.05.2023 18:27

Hi. I am having a bit of a difficult time trying to draw the chessboard due to a smaller screen size. Any ideas on how I can go about this?

Ответить
goodevening
goodevening - 09.05.2023 19:20

great tutorial! just as we were asked to make a chess game as our final homework task for a programming class, still i need to add more features like castling and other , but i guess i'll figure it out

Ответить
HUrpy Hurpy
HUrpy Hurpy - 19.04.2023 12:10

Very cool guide, thank you !! Can you maybe show us how you would implement castling, en passant and promoting pieces?

Ответить
HBCoding
HBCoding - 16.04.2023 23:35

Great vid bud. Will work through it.

Ответить
landon quijada
landon quijada - 14.04.2023 04:51

whats the software you use?

Ответить
ben
ben - 09.04.2023 06:12

Others : They need to read many books and have multiple teachers to improve their coding skills and add to their resume.
Me: I believe that I only need lemastertech to take me 100 times further in programming

Ответить
TommyNguyen
TommyNguyen - 07.04.2023 16:05

Well done,bro!

Ответить
C&HWS
C&HWS - 03.04.2023 19:14

wow I love chess and I always wanted to make it in a programing language, but I just couldn't find the right tutorial... then u uploaded this video and finely I'm satisfied! thanks for the content!👍

Ответить