Book Image

Mastering LibGDX Game Development

By : Patrick Hoey
Book Image

Mastering LibGDX Game Development

By: Patrick Hoey

Overview of this book

Table of Contents (18 chapters)
Mastering LibGDX Game Development
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Implementing your player character with animation


The next class that we will look at in our class diagram hierarchy is the Entity class that can be found at core/src/com/packtpub/libgdx/bludbourne/Entity.java. The Entity class represents the primary game object, including the player character and non-playable characters (NPCs), which can move around in the world and interact with their environment.

Entity

The following class diagram demonstrates the relevant attributes and methods that we are going to use for this chapter (Figure 11):

Figure 11

We will discuss some of the imports from the source code of Entity:

package com.packtpub.libgdx.bludbourne;

import java.util.UUID;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils...