Sunday, 23 October 2016

Sleepless Nights

Print("Life as a Programmer")


Yeah being a programmer is the absolute best. I always wanted to stay up late writing code ( please note the sarcasm). Well anyway on with the point. I spent ages trying to figure how to get the pieces to move on the screen but all the effort I did was really for nothing because the point was that all the work that I was doing was on the front end and that is pointless. Therefore, I then decided to go try and make a console based version of the game first and then link that to my GUI. This meant that all the previous effort was in vain but oh well that is what programming is about. I really did learn something though. Next time I should get work on a console based logic and then go to the GUI from there. Well lesson learnt i went forth with my quest, and finding inspiration from some sources on the internet like the following, i decided to make the game object oriented (or at least try to):
https://github.com/yono38/Simplified-Checkers/blob/master/checkers.py


With my limited knowledge of Object Oriented Programming in Python (although I am studying OOP in C++) and my almost zero knowledge of pyglet i meandered into unknown waters and somehow ended up with a little progress and a lot of dark circles (the dark circles weren't really new but the sleepless nights that caused them sure were).

Yeah The screen looks like nothing but there is a lot of back end work here that cannot be seen. I made the classes i would need with their functions and i also added mouse press functionality, although that is annoying me now and is the next thing that I want to work on.What it does now is that the first press just works once (that is the one that removes a pawn from the board) and then the other left clicks keep adding pawns to the board like this. That is obviously not what I want. So much for the weeks spent on this. It seems like I have done nothing. But you don't know the effort it took to set it properly on the screen when i had to relate it an internal two dimensional array which represents the board. getting the indices just right took a long time. I stayed up till two once trying to figure it out with no luck but then I solved the issue the next day (my luck in things like this is just strange....). Well anyway i have the game without the jump condition right now. And i also have to do something about this mouse press event. Linking it is very annoying and I still don't know quite how it works. Well anyways I should go now. I hope the next time I post I have something much more to show you.. Maybe I will just be left with the AI(as if!)

print("Google I think I am ready for you now! Well I am ready to beat you not be you!")

No comments:

Post a Comment