Re: Silver Chess - My first LOVE game!
Posted: Fri Aug 26, 2016 2:43 pm
Can you please go into detail as to why this is a bad idea? I'm not sure what your expertise is, or if you're familiar with metatables, but all of the methods associated with each of my pieces is stored on it's respective metatable, and not the object itself. If you print out the contents of one of my pieces, say, that pawn on a2 you will see the following:ivan wrote:Having a different Lua "object" for each piece is just not a good approach,
it's possible to make something like that work, but it's going to be a memory hog at best.
Code: Select all
for k, v in pairs(board[1][2]:GetPiece()) do
print(k, v)
end
square table: 0x005ee520
color white
Except that, in the latest version that I downloaded from your post, it doesn't seem to support castling, which, by the way, is a move.ivan wrote:Less code and it can generate all legal moves (both "to" and "from" any square).
https://en.wikipedia.org/wiki/Castling
Forgive me if I sound defensive, it's because I am. I don't see the legitimacy to some of the claims you made about how this game is unfinished and "a good start" when, aside from A.I., is actually more feature complete than the version you tried to suggest that I look at.
All-in-all, I am actively working on, albeit, minor optimizations - I'm not gonna completely rewrite this game - to the drawing and other parts which would greatly benefit from optimization. Other new features to be added are actively in the works also, which will be showcased as soon as possible.