File indexing completed on 2024-05-05 04:02:04

0001 /*
0002     SPDX-FileCopyrightText: 2007-2008 John-Paul Stanford <jp@stanwood.org.uk>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef PLANE_H
0008 #define PLANE_H
0009 
0010 #include "explodable.h"
0011 
0012 /**
0013  * This class is used to represent the plane object in the game. It extends class
0014  * explodable as the plane will explode when it hits buildings. The plane
0015  * flys from left to right and each time it goes off the side of the screen it
0016  * is repositioned back at the left side, one place lower than before.
0017  */
0018 class Plane : public Explodable
0019 {
0020 public:
0021     /** This is the planes size relative to the tile */
0022     static const qreal PLANE_RELATIVE_SIZE;
0023 
0024     /** This is the position before the plane goes off the screen */
0025     static const qreal PLANE_MAX_POSITION_X;
0026 
0027     /** The speed the plane will fly at */
0028     static const qreal DEFAULT_VELOCITY;
0029 
0030     Plane(KGameRenderer * renderer, BomberBoard * board);
0031     ~Plane() override;
0032 
0033     /**
0034      * Performs move calculations
0035      * This method is called once per frame
0036      */
0037     void advanceItem();
0038 
0039     /**
0040      * Used to reset the plane to it's starting position
0041      */
0042     void resetPosition();
0043 };
0044 
0045 #endif