1#include "BasicCamera.hpp"
7 BasicCamera::BasicCamera(
Engine& engine,
const std::string& name) :
GameObject(engine, name) {
8 AddComponent(TransformComponent{});
9 AddComponent(CameraComponent{});
16 inputComp.
addBinding(SDL_SCANCODE_W, InputActionState::Held, [
this](
float deltaTime) {
19 inputComp.
addBinding(SDL_SCANCODE_S, InputActionState::Held, [
this](
float deltaTime) {
22 inputComp.
addBinding(SDL_SCANCODE_D, InputActionState::Held, [
this](
float deltaTime) {
25 inputComp.
addBinding(SDL_SCANCODE_A, InputActionState::Held, [
this](
float deltaTime) {
Contains basic components like transform, camera, name components..
This file defines GameObjectFactory class used to auto register GameObjects.
#define REGISTER_GAME_OBJECT(ClassName)
Macro for automatic GameObject registration, you should call it at the bottom of your class implement...
void Update(float deltaTime) override
virtual void function you override to implement custom behavior when the game updates (eg....
void BeginPlay() override
virtual void function you override to implement custom behavior when the game starts.
Class for interaction with engine systems.
Its base class for all game objects, eg. Player, Enemy, Weapon. Your Class needs to inherit from it.
T & GetComponent()
Function that returns reference to a requested component.
void AddComponent(const T &comp)
Function that adds a component to the GameObject.