release v1.3 beta 1
This commit is contained in:
77
source/movingsprite.h
Normal file
77
source/movingsprite.h
Normal file
@@ -0,0 +1,77 @@
|
||||
#pragma once
|
||||
#include "ifdefs.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#ifndef MOVINGSPRITE_H
|
||||
#define MOVINGSPRITE_H
|
||||
|
||||
// Clase MovingSprite. Añade posicion y velocidad en punto flotante
|
||||
class MovingSprite : public Sprite
|
||||
{
|
||||
public:
|
||||
// Constructor
|
||||
MovingSprite();
|
||||
|
||||
// Destructor
|
||||
~MovingSprite();
|
||||
|
||||
// Iniciador
|
||||
void init(float x, float y, int w, int h, float velx, float vely, float accelx, float accely, LTexture *texture, SDL_Renderer *renderer);
|
||||
|
||||
// Mueve el sprite
|
||||
void move();
|
||||
|
||||
// Muestra el sprite por pantalla
|
||||
void render();
|
||||
|
||||
// Obten el valor de la variable
|
||||
float getPosX();
|
||||
|
||||
// Obten el valor de la variable
|
||||
float getPosY();
|
||||
|
||||
// Obten el valor de la variable
|
||||
float getVelX();
|
||||
|
||||
// Obten el valor de la variable
|
||||
float getVelY();
|
||||
|
||||
// Obten el valor de la variable
|
||||
float getAccelX();
|
||||
|
||||
// Obten el valor de la variable
|
||||
float getAccelY();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setPosX(float x);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setPosY(float y);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setVelX(float x);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setVelY(float y);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setAccelX(float x);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setAccelY(float y);
|
||||
|
||||
private:
|
||||
// Posición
|
||||
float mPosX;
|
||||
float mPosY;
|
||||
|
||||
// Velocidad
|
||||
float mVelX;
|
||||
float mVelY;
|
||||
|
||||
// Aceleración
|
||||
float mAccelX;
|
||||
float mAccelY;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user