Move through course, sprite and input
Signed-off-by: Daniel Henry <iamdanhenry@gmail.com>
This commit is contained in:
@@ -1,20 +1,42 @@
|
||||
#pragma once
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include "framework/Core.h"
|
||||
#include "framework/Object.h"
|
||||
#include "framework/AssetManager.h"
|
||||
|
||||
class World;
|
||||
|
||||
namespace ly {
|
||||
class World;
|
||||
|
||||
class Actor {
|
||||
class Actor : public Object {
|
||||
public:
|
||||
Actor(World *owningWorld);
|
||||
Actor(World *owningWorld, const std::string& texturePath = "");
|
||||
virtual ~Actor();
|
||||
|
||||
void BeginPlayInternal();
|
||||
virtual void BeginPlay();
|
||||
void TickInternal(float deltaTime);
|
||||
virtual void Tick(float deltaTime);
|
||||
void SetTexture(const std::string& texturePath);
|
||||
void Render(sf::RenderWindow& window);
|
||||
|
||||
void SetActorLocation(const sf::Vector2f &newLocation);
|
||||
void SetActorRotation(const float newRotation);
|
||||
void AddActorLocationOffset(const sf::Vector2f& offset);
|
||||
void AddActorRotationOffset(const float offset);
|
||||
sf::Vector2f GetActorLocation() const;
|
||||
float GetActorRotation() const;
|
||||
sf::Vector2f GetActorForwardDirection() const;
|
||||
sf::Vector2f GetActorRightDirection() const;
|
||||
|
||||
|
||||
private:
|
||||
void CenterPivot();
|
||||
World *mOwningWorld;
|
||||
bool mHasBeganPlay;
|
||||
|
||||
sf::Sprite mSprite;
|
||||
shared<sf::Texture> mTexture;
|
||||
};
|
||||
|
||||
} // namespace ly
|
||||
|
||||
Reference in New Issue
Block a user