#ifndef ZOMBIESIMPLE_H
#define ZOMBIESIMPLE_H

#include <QObject>
#include <QGraphicsPixmapItem>
#include <QPropertyAnimation>
#include <QTimer>

class zombieSimple : public QObject, public QGraphicsPixmapItem
{
    Q_OBJECT
    Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged)
    Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged)
public:
    explicit zombieSimple(QPixmap pixmap);
    virtual ~zombieSimple();

    qreal x() const;
    void setX(qreal newX);

    qreal y() const;
    void setY(qreal newY);

    void addTrajectoryPoint(QPointF);


public slots:
    void startTrajectory();
    void animationFinished();
    void checkProyectil();

signals:
    void xChanged();
    void yChanged();
    void nextTrajectoryPoint();
    void checkAnimationFinished();
    void checkMove();

private:
    qreal m_x;
    qreal m_y;
    int trajectoryPos;
    QList<QPointF> trajectory;
    QPropertyAnimation * xAnimation;
    QPropertyAnimation * yAnimation;
    QTimer * hitProjectileTimer;
    bool xAnimationFinished;
    bool yAnimationFinished;
};

#endif // ZOMBIESIMPLE_H
