32 lines
592 B
C++
32 lines
592 B
C++
#pragma once
|
|
|
|
#include <SDL2/SDL.h>
|
|
#include "actor.h"
|
|
#include <string>
|
|
|
|
#ifndef ACTOR_MOVING_PLATFORM_H
|
|
#define ACTOR_MOVING_PLATFORM_H
|
|
|
|
// Clase Actor
|
|
class ActorMovingPlatform : public Actor
|
|
{
|
|
private:
|
|
SDL_Point p1; // Punto 1 (inicial) de la ruta
|
|
SDL_Point p2; // Punto 2 (final) de la ruta
|
|
|
|
// Comprueba si ha llegado al limite del recorrido para darse media vuelta
|
|
void checkPath();
|
|
|
|
public:
|
|
// Constructor
|
|
ActorMovingPlatform(actor_t actor, SDL_Point p1, SDL_Point p2);
|
|
|
|
// Destructor
|
|
~ActorMovingPlatform();
|
|
|
|
// Actualiza las variables del objeto
|
|
void update();
|
|
};
|
|
|
|
#endif
|