Input classes
Each of these classes handles a specific input method used in the game:
BoundTouchInput.java
The BoundTouchInput
class facilitates the delegation of inputs, which are then bound to the BoundTouchInput
class. This can be easily seen in-game when moving MagneTank to aim at the turret. When the touch enters another touchable area, it stays tied to the original area.
GrowButton.java
The GrowButton
class simply shows an image that grows to a specific scale when the player is touching it and returns to its original scale when the touch is lifted or lost.
This class is based on the following recipes:
Understanding AndEngine entities in Chapter 2, Working with Entities
Bringing a scene to life with sprites in Chapter 2, Working with Entities
Overriding the onManagedUpdate method in Chapter 2, Working with Entities
Using modifiers and entity modifiers in Chapter 2, Working with Entities
GrowToggleButton.java
Based on the GrowButton
class, this class adds the functionality to show one or two TiledTextureRegion
indices, depending on the state of a condition.
The GrowToggleButton
class is based on the following recipes:
Understanding AndEngine entities in Chapter 2, Working with Entities
Bringing a scene to life with sprites in Chapter 2, Working with Entities
Overriding the onManagedUpdate method in Chapter 2, Working with Entities
Using modifiers and entity modifiers in Chapter 2, Working with Entities
GrowToggleTextButton.java
Based on the GrowToggleButton
class, this class uses a Text
object instead of a TiledTextureRegion
object to show the state of a condition.
The GrowToggleTextButton
class is based on the following recipes:
Understanding AndEngine entities in Chapter 2, Working with Entities
Bringing a scene to life with sprites in Chapter 2, Working with Entities
Applying text to a layer in Chapter 2, Working with Entities
Overriding the onManagedUpdate method in Chapter 2, Working with Entities
Using modifiers and entity modifiers in Chapter 2, Working with Entities