Creando subclases de actors
This commit is contained in:
31
source/actor_moving_platform.h
Normal file
31
source/actor_moving_platform.h
Normal 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
|
||||
Reference in New Issue
Block a user