Circle of Death
Circle of Death was quick and dirty. I had just started learning code, and had no idea of good code practices. I manually wrote many things that should have been looped. I included way too many things in one class, and I basically eliminated any possibility of future alteration. But it works.
I used a CardDeck Class with variables for each image to draw a random card, then add that card to the “used pile”.
I then made UI classes (my first attempt at java UI) and a gameLogic class which took the drawn card and kept track of what was happening in the game.
If you want to look at the code (or play the game) my gitHub has all source code and a runnable jar file here.
Horse Races
By this point, I had gotten a little bit better at UI, so this game didn’t take nearly as long, and is much more visually appealing. On the backend, I switched to using arrays to store images and programmatically create Card objects, rather than randomly drawing an image. I also created a set of functions to simulate real card deck usage (splitting, reshuffling, and separating out specific cards). This allows me to use my cardDeck class for other applications, opening the game up for modification.
To take a look at these games, download from the gitHub link here.
My next couple posts will be about my current project-in-progress: a robotic bartender.
Reblogged this on dnslookupfr.
LikeLike