BattleState

We will first look at the primary business logic that maintains the state and calculations involved in determining the outcome of a particular player's battle with an enemy. The following code snippet represents the BattleState class, which can be found at core\src\com\packtpub\libgdx\bludbourne\battle\BattleState.java:

package com.packtpub.libgdx.bludbourne.battle;

import com.badlogic.gdx.math.MathUtils;
import com.packtpub.libgdx.bludbourne.Entity;
import com.packtpub.libgdx.bludbourne.EntityConfig;
import com.packtpub.libgdx.bludbourne.UI.InventoryObserver;
import com.packtpub.libgdx.bludbourne.profile.ProfileManager;

public class BattleState extends BattleSubject implements 
   InventoryObserver {

We need a way to communicate changes ...

Get Mastering LibGDX Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.