The previous Python code just had the source code but none of the GUI components that were needed (pictures, fonts). So now this is the working, but still very alpha, source code. Run “GuiMain” in the gui directory. All you can do is move 3 card images around. You cannot move the card outside of its current zone. The three colored region on the screen represent your hand, your play area and the computer’s play area.
When you move the card it “bleeds” (look at the picture to see what I mean). This behavior is on purpose although it may seem like a bug. First a little background. For one, I don’t know anything about graphics programming other than the basic xy coordinate plane. (I actually did teach a few months of geometry, go math!!) Two, I thought I could just draw the whole screen 15 times a second but my computer isn’t that fast. So my compromise is that I only redraw the card that is moving and I don’t redraw everything.
In order to correct the bleeding effect, I should redraw the background where the card was previously at. That is easier said than done because I don’t know anything about graphics programming. Basically I feel like I am building my first dog house. I know the tools, hammer, nails, wood but I’m not sure how to best use them. I know the end result that I want, but I don’t know the exact steps.
This code requires Python and Pyglet
Download Source Code