Potato Engine
Loading...
Searching...
No Matches
Player Class Reference

User controllable character. More...

#include <Player.hpp>

Inheritance diagram for Player:
Entity Actor Archivable Tickable

Protected Member Functions

virtual void BeginPlay () override
 Gameplay start.
virtual void Tick (float dt) override
 Update tick event.

Additional Inherited Members

Public Member Functions inherited from Entity
float TakeDamage (float damage)
 Delivers damage to the entity.
float AddHealth (float amount)
 Adds health to entity.
float GetHealth () const
 Gets health.
Public Member Functions inherited from Actor
 Actor ()
 Constructs actor object.
Vector2 GetPosition () const
 Gets position.
void SetPosition (const Vector2 &position)
 Sets position.
Vector2 GetSize () const
 Gets size.
void SetSize (const Vector2 &size)
 Sets size.
float GetRotation () const
 Gets rotation.
void SetRotation (float rotation)
 Sets rotation.
void AddLocalOffset (const Vector2 &offset)
 Adds to location vector.
void AddLocalRotation (float rotation)
 Adds to rotation value.
bool isVisible () const
 Checks if actor visible.
void SetVisibility (bool visibility)
 Sets visibility of actor.
void DispatchBeginPlay ()
 Internal function used to queue BeginPlay() on actor.
Public Member Functions inherited from Tickable
bool isTicking () const
 Checks if object is ticking.
void SetTicking (bool isEnabled)
 Sets tick state for object.
Public Attributes inherited from Actor
char Texture
Protected Attributes inherited from Entity
float Health
float MaxHealth

Detailed Description

User controllable character.

Definition at line 11 of file Player.hpp.

Constructor & Destructor Documentation

◆ Player()

Player::Player ( )

Definition at line 13 of file Player.cpp.

◆ ~Player()

Player::~Player ( )
virtual

Definition at line 29 of file Player.cpp.

Member Function Documentation

◆ BeginPlay()

void Player::BeginPlay ( )
overrideprotectedvirtual

Gameplay start.

Put all pre-gameplay functionality here

Note
Always call base method when overriding:
void ActorClass::BeginPlay() {
BaseActor::BeginPlay();
// ...
}

Reimplemented from Actor.

Definition at line 16 of file Player.cpp.

◆ Tick()

void Player::Tick ( float dt)
overrideprotectedvirtual

Update tick event.

This function is called every tick on the update step. Put all gameplay functionality that should run every update here (custom movement logic, etc.)

Parameters
dtDeltatime; time elapsed since last frame in ms
Note
Always call base method when overriding:
void Class::Tick() {
BaseClass::Tick();
// ...
}

Reimplemented from Actor.

Definition at line 22 of file Player.cpp.