NWengine 0.9
Loading...
Searching...
No Matches
Animator.h
1#pragma once
2#include "GameObject.h"
3#include "Animation.h"
4#include "Sprite.h"
5
6class Animator : public GameComponent {
7private:
8 double cycle = 0; //Keeps track of time to update frame
9public:
10 static std::string GetType() { return "Animator"; };
11 Animator() {};
12 Animator(GameObject* attachedObj);
13 GameObject* attachedObj = nullptr;
14 uint16 currentFrame = 0;
15 bool isActive = 1;
16
17 Animation animation;
18 void Update();
19
20 void SetGameObject(void* go) override;
21 void* GetGameObject() override;
22};
Defines the GameObject class and its related components.
Defines the Sprite class, which represents a game sprite.
The Animation class represents a sequence of frames with durations.
Definition Animation.h:10
Represents an animator component that can be attached to a game object.
Definition Animator.h:6
void Update()
Update the game component.
Definition Animator.cpp:8
void SetGameObject(void *go) override
Set the GameObject associated with the game component.
Definition Animator.cpp:25
void * GetGameObject() override
Get the GameObject associated with the game component.
Definition Animator.cpp:28
Base class for game components.
Definition GameObject.h:29
Class representing a game object.
Definition GameObject.h:68