stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

1h 20m 54s logged

Devlog 3

Added actual pygame rendering, piece images on their tiles, and basic clicking events on tiles. I am currently having one issue with my pieces not being centered on their tiles hopefully an easy fix. But overall I’m making solid progress. It definitely gets hard to code every day while coming home from school tired every day but I will push through.

The picture below shows my progress with this so far. I’ve addded from last devlog to this one:

  • Rendering board with PyGame
  • Rendering pieces with their images onto the tile they currently are on
  • When a piece is clicked it outlines the tile in red
0
0
42
Open comments for this post

1h 3m 17s logged

Devlog 2

Did not do much for this devlog. I mainly did refactor work and cleaning up my code. But I discovered a new thing about python.

DUNDER METHODS

These are actually really cool and they add some additional functionality to your classes that you make. For example in my use I use the:

__str__()

dunder (double underscore) method which allows me to call print() on my class and print whatever I want to print for my class. Here is how I’m using it:

# inside of the board class
def __str__(self):
     board_str = ""
     for y in range(8):
        for x in range(8):
             piece = self.grid[x][y]
             if piece:
                  board_str += f"{piece.type[0].upper() if piece.team == 'white' else piece.type[0].lower()} "
             else:
                 board_str += ". "
            board_str += "\n"
     return board_str

# How you call it assuming you've already declared a board object called board.
print(board) 

This allows for easier and cleaner code for debugging. This code snippet prints what is shown in the photo.

2
0
49
Open comments for this post

47m 41s logged

Devlog 1

I got a little busy with school and my social life so I have not worked much on this project yet. Definitely a little step down from my grand project that I just finished. (You should check it out, it’s called Tetr.AI). But I want something a little more relaxed to work on. So I opted to make my own Chess engine built in python. And making this project could lead to some other future projects maybe a cool chess bot or an AI that learns to play chess.
|
So I just got finished with the basic board initialization and piece initialization. Nothing too much.

0
0
13

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…