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 Deck Classes

Picture of the Perang Deck of Cards

See the full Java Deck Classes by clicking the buttons below.

Java Full Deck Class Java Player Deck Class

The Java Edition has two Deck classes, Full Deck and Player Deck. As titled, the Full Deck class stores the entire deck of Perang cards while the Player Deck is only filled with Cards the player started with or has earned. The Decks are built with information stored in the Game Data class. In both decks, the Cards are stored as an Array List.

Picture of the Player Deck and Full Deck Class variables.

To keep multiple instances of the Full Deck from being created, the single_instance variable is used in conjuction with a getInstance method. There is no need to do this for the Player Deck because there are two players and therefore two player decks get created during a session. Or at least, that was the plan. Both the Java and Unreal editions only create a single Player Deck. During a battle, the AI's cards are pulled from the Full Deck. This process is only for the stand-alone edition. When this gets inserted into the main game, non-player characters will be given an AI deck which will combine a set of static cards, which the AI NPC will always carry, and some random cards.

More to come...

Next Class: The Board

The Board →