Files
volcano_2022/source/actor_moving_platform.h

36 lines
654 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:
// Variables
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();
// Actualiza la variable
void updateShift();
public:
// Constructor
ActorMovingPlatform(actor_t actor, SDL_Point p1, SDL_Point p2);
// Destructor
~ActorMovingPlatform();
// Actualiza las variables del objeto
void update();
};
#endif