Sequences are defined on XML files. Each Sequence has a name and a set of Shots. Each Shot has a type, a start and an interval.

Attributes:

    • name: just for information purposes
    • type: which Shot will be used
    • start: where the Shot will start vertically (percentage of the screen)
    • interval: time in milliseconds to wait before firing

Example 1:

This is a simple sequence that will fire type 1 shots on the middle of the screen in 1 second intervals

Example 2:

This sequence will fire type 1 shots on different positions in 1 second intervals

Sequence.java

All the Sequences are defined on a single class. The resources are stored on static variables to improve performance and make them resusable by all instances.

Sequences have a set of shots. This class is responsible to load Sequence resources and to handle all Sequence interactions.

sequence_001.xml

sequence_002.xml

sequence_003.xml

SVN Project:

PingPong Madness Tutorial – Part 03 SVN

APK:

PingPong Madness Tutorial – Part 03.apk

Tutorial: