add intro animation

This commit is contained in:
arthur.jamet
2021-06-10 15:10:14 +02:00
parent ffccdf6fcb
commit 57f9d5446a
4 changed files with 134 additions and 0 deletions
@@ -0,0 +1,17 @@
//
// Created by Zoe Roux on 5/24/21.
//
#include "IntroAnimationComponent.hpp"
namespace BBM
{
IntroAnimationComponent::IntroAnimationComponent(WAL::Entity &entity)
: WAL::Component(entity)
{}
WAL::Component *IntroAnimationComponent::clone(WAL::Entity &entity) const
{
return new IntroAnimationComponent(entity);
}
}
@@ -0,0 +1,40 @@
#pragma once
#include <Component/Component.hpp>
namespace BBM
{
//! @brief A component to slowly center entities to the middle of their current block.
//! This allow flexibility in their movement will preventing them from getting stuck at every corner.
class IntroAnimationComponent : public WAL::Component
{
public:
unsigned int frame = 0;
enum animationSteps {
init,
boxBlinking,
topLeftgrowing,
bottomRightGrowing,
lettersTyping,
fading,
prompt,
};
enum animationSteps currentStep = init;
//! @inherit
Component *clone(WAL::Entity &entity) const override;
//! @brief Create a new, default IntroAnimationComponent.
//! @param entity The entity attached to this component.
explicit IntroAnimationComponent(WAL::Entity &entity);
//! @brief A IntroAnimationComponent is copy constructable
//! @param other The other IntroAnimationComponent to copy.
IntroAnimationComponent(const IntroAnimationComponent &other) = default;
//! @brief A default destructor
~IntroAnimationComponent() override = default;
//! @brief A IntroAnimationComponent is not assignable
IntroAnimationComponent &operator=(const IntroAnimationComponent &) = delete;
};
}