Update LevelManager and GameObjectFactory

Now we have a new object ready to go we can quickly update the LevelManager and GameObjectFactory. Uncomment this code in the LevelManager class.

case 'm':
   //objects.add(factory.create(
   // new MoveablePlatformSpec(),
   // coords));
   break;

Add this highlighted line of code to the GameObjectFactory class.

...
case "InanimateBlockUpdateComponent":
   object.setMovement(new
                InanimateBlockUpdateComponent());
   break;
case "MovableBlockUpdateComponent":
   // Code coming soon
   object.setMovement(new 
                MovableBlockUpdateComponent());
   break;
case "DecorativeBlockUpdateComponent":
   object.setMovement(new
               DecorativeBlockUpdateComponent());
   break;
...

The LevelManager will now request moving platforms from the factory and the factory ...

Get Learning Java by Building Android Games - Second Edition 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.