Coding the inanimate and decorative components

In the previous chapter we coded all the interfaces for our component classes. We coded GraphicsComponent, UpdateComponent and InputComponent. Now we will code the three simplest component classes that will be enough to complete quite a few of our specifications.

Let's start with the DecorativeBlockUpdateComponent.

DecorativeBlockUpdateComponent

The update-related components all implement just one method, update. Add a new class called DecorativeBlockUpdateComponent, implement UpdateComponent and add the empty update method as shown next.

class DecorativeBlockUpdateComponent implements UpdateComponent { @Override public void update(long fps, Transform t, Transform playerTransform) { // Do nothing // Not ...

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.