Two Cat Games

presents

Perang: 3 Card Battle

Blueprints image background

Blueprints

Perang: 3 Card Battle was originally created in Java and was entirely text based. I used the code from the Java project to baseline what I needed for the Unreal edition. I'll be posting the Java code here along with screen shots of the Unreal Blueprints.

To examine the Blueprints for this game, I'm going to break it down by classes originally created in Java and then further examine the graphical elements needed for the visuals. Let's get started.

Perang: 3 Card Battle was originally created in Java and was entirely text based. I used the code from the Java project to baseline what I needed for the Unreal edition. I'll be posting the Java code here along with screen shots of the Unreal Blueprints.

To examine the Blueprints for this game, I'm going to break it down by classes originally created in Java and then further examine the graphical elements needed for the visuals. Let's get started.

Click to find out.

If you are unfamiliar with Java classes, you can think of a class as a real-world object such as a card or ball. They each have a set of attributes that define what they look like and how they interact in the world. A ball can be thrown, bounced, caught, etc. A card can be dealt, flipped, burned, etc. A Java Ball Class would have weight, density, size, texture, etc. When an instance of the Ball Class is made, you set those attributes based on what you want it to do such as be a baseball or be a bouncy ball. Both are balls but have very different attributes.

In Unreal Engine, a Blueprint is similar to a Java class in that it defines an object but is created with a visual interface.

Card Card Slot Deck Board State Machines Data Table

The Card Slot Class

Picture of the Perang Card Slot

See the full Java Card Slot Class by clicking the button below.

Java Card Slot Class

The 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. Picture of the Java Card Slot Variables

Card Slot Methods

Build Attack Buttons or in Java buildCanAttack()

Picture of Blueprints to Build Attack Buttons with a small window with buildCanAttack java method.

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 →