Building the GameObjectFactory class
It is the job of the GameObjectFactory
class to use the ObjectSpec-based classes to assemble GameObject
instances with the correct components.
Create a new class called GameObjectFactory
and add the following members and constructor:
import android.content.Context; import android.graphics.PointF; class GameObjectFactory { private Context mContext; private PointF mScreenSize; private GameEngine mGameEngineReference; GameObjectFactory(Context c, PointF screenSize, GameEngine gameEngine) { this.mContext = c; this.mScreenSize = screenSize; ...