The Card Slot Class
See the full Java Card Slot Class by clicking the button below.
Java Card Slot ClassThe Java Card Slot class has variables to define it's position on the board, an array to indicate valid attack directions, a Card, a Player and a Face Up boolean.
Card Slot Methods
Build Attack Buttons or in Java buildCanAttack()
As you can see from the image, the Unreal Blueprints to build the attack buttons is long, while the equivelant Java class is 15 lines long. In case it's hard to see, there's a small window in the upper right corner of the blueprints image with the buildCanAttack method.
Of course there are couple more variables which have to be set for spawning the buttons in 3D. There is also a seperate Blueprint Class for the attack buttons themselves and those variables have to be set as well. This function takes care of all that for both player and AI for every card slot that gets created. The opening branch splits between player and AI then a switch determines which buttons will get created and where. The outer slots only need two buttons and the center slot gets all three. I'll talk about the buttons more during the Button Blueprint Class expo.
Next Class: The Decks
The Decks →