I have recently started my first Hackathon! Flatiron School is hosting a Game Jam. This Game Jam is a small 2 week event where different teams work on building out a game. I’ve teamed up with 2 other excellent developers whose GitHubs are linked at the bottom of this post. The project that we have decided to make is a game of Blackjack.
Everything with the app is still a work in progress. So the work that I am gonna show may not be in the final app, but here are my contributions to this project so far.
First I helped out with Player Logic. I created 4 checks that the game will do to determine the overall game state. Each will check if the game is on-going and what the player’s current status is.
playerTurn? will check if the player’s hand is over 21. In Blackjack a player will “bust” if their current hand value is over 21, so we return false if this has happened. We, in the future, will look to see if a player “stands” or choses not to draw anymore. playerLost? will check multiple things. If they player is over 21 or “busted”. If the dealer’s hand better than the players, or the dealer has 21. playerWon? will check if the player’s hand is better than the dealer. playerPush? will check if the player’s hand is equal to the dealer.
Another big contribution was the addition of a handleLoading on the frontend
For this project, we are using an external API to get cards from a deck. We were having problems with getting the information to render on the page. The component would load before getting info from the API and wouldn’t render anything. This was a problem I had on a past project so I implemented a similar fix. I made a small If statement that won’t pass until props becomes populated. When it does that, our <CardsArray /> component won’t render until we get our cards. When we do get the cards, we show what card it is on the page.
Project is still early on, so there isn’t too much to show right now. However, work on this project is going very well. I feel like I’ve already gain invaluable experience of working in a group project and I am excited to see how this project progresses. If you are ever on the fence of joining a hackathon, I’d say go for it! It’s a lot of fun and you will gain a lot out of it.
I hope that you check out the next blog to see my final thoughts on the project. I’ll post the link to the repository there. Also huge thank to my group. They are very talented and you can check out their GitHubs here: https://github.com/Sransonette | https://github.com/gracenak. Here is the link to the external API we are using in our project: http://deckofcardsapi.com/
If you want to see more of my projects, here is the link to my own GitHub page: https://github.com/JakeKViti