Creando subclases de actors

This commit is contained in:
2022-08-26 07:24:22 +02:00
parent 6b2901cebc
commit aea71599ff
3 changed files with 71 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
#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();
// Destructor
~ActorMovingPlatform();
// Actualiza las variables del objeto
void update();
};
#endif