Skip to Main Content
Mastering LibGDX Game Development
book

Mastering LibGDX Game Development

by Patrick Hoey
November 2015
Beginner to intermediate content levelBeginner to intermediate
420 pages
9h 2m
English
Packt Publishing
Content preview from Mastering LibGDX Game Development

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Libgdx Game Development

Learning Libgdx Game Development

Andreas Oehlke
Libgdx Cross-platform Game Development Cookbook

Libgdx Cross-platform Game Development Cookbook

David Saltares Márquez, Alberto Cejas Sánchez
Learning LibGDX Game Development - Second Edition

Learning LibGDX Game Development - Second Edition

Suryakumar Balakrishnan Nair, Andreas Oehlke

Publisher Resources

ISBN: 9781785289361Supplemental Content