Every object is a GameObject
This class will become a living-breathing (or flying-shooting or diving) combination of our various components.
Create the GameObject
class and add the import
statements and constructor shown here:
import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.PointF; class GameObject { Â Â Â Â private Transform mTransform; Â Â Â Â private boolean isActive = false; Â Â Â Â private String mTag; Â Â Â Â private GraphicsComponent graphicsComponent; Â Â Â Â private MovementComponent movementComponent; Â Â Â Â private SpawnComponent spawnComponent; }
Here, we can see that we have an instance of the Transform
class called mTransform
. In addition, we have a boolean
member variable called isActive
. This will act as an indicator of whether the object is currently in use or not. The mTag
variable will be...