Devlog #2: Full Functionality(ish)
DEVLOG #2: Core Functionality(ish)
Well, its only been a week and I've managed to completely forget about the devlogs. Let's fix that, shall we?
Not much to talk about this week, but the main addition is that betting is officially open! You can now trust in the heart of the cards and gamble to your heart's content!
Now, obviously there's still some work left to do, namely implement these features for the rest of the game modes, as well as add a little (read: a lot) of polish overall. But for now, let's take a little peek behind the scenes to see what makes it all tick.\
So, a lot of the heavy lifting is done by the functions in BetPayout(), a new static class built so that the functions can easily be called from anywhere. The only caveat is that since static classes can't be assigned to GameObjects, other boilerplate code is needed elsewhere to point to these functions.
When payWinnings is called, it takes a modifier as an int, as well as the gamemode it's being called in as a string. From here, the amount of winnings to pay out is calculated by multiplying the value of the bet by the modifier provided. After this, the money is deposited back into the player's account. From here, the player's bet is either reset to zero if playing blackjack, or something else if it's relevant to that gamemode.
If a player loses the bet, then instead of payWinnings, a different function called noPayout is called. This function simply zeroes out the bet, and then resets the bet using money from the player, if needed for the gamemode.
Now, as mentioned earlier, statics can't be called directly from the game, and instead need to be pointed to through other scripts attached to gameObjects. To that end, some extra code is added to BlackjackGame.cs, which allows for the game to be concluded, as well as providing the win conditions for the gamemode.
Well, that about covers everything new that's been added in the last... amount of time. Tune in next week for when I actually, actually finish implementing all the functionality (for real, this time!)
Files
Casino Rush
The thrills of the casino, in the palm of your hand!
Status | In development |
Author | Glori0usOCE |
More posts
- Devlog #6 - Final SubmissionOct 17, 2023
- Devlog #5 - Testing Session FeedbackOct 17, 2023
- Devlog #4 - Game Art and Testing SessionOct 16, 2023
- Devlog #3 - Full GameplayOct 15, 2023
- Devlog #1: Core FunctionalitySep 11, 2023
- Project Treatment - Casino FeverAug 28, 2023
Leave a comment
Log in with itch.io to leave a comment.