12345678910111213141516171819202122232425262728293031323334353637383940 |
- /*
- * 2D Game Engine
- * ProjectileEmitter.h:
- * Based on pikuma.com 2D game engine in C++ and Lua course
- * Copyright (c) 2021 986-Studio. All rights reserved.
- *
- * Created by Manoël Trapier on 27/02/2021.
- */
- #ifndef GAMEENGINE_SOURCE_INCLUDE_COMPONENTS_PROJECTILEEMITTER_H
- #define GAMEENGINE_SOURCE_INCLUDE_COMPONENTS_PROJECTILEEMITTER_H
- #include <SDL.h>
- #include <ECS.h>
- #include <glm/glm.hpp>
- struct ProjectileEmitterComponent
- {
- glm::vec2 projectileVelocity;
- uint32_t repeatFrequency;
- uint32_t projectileDuration;
- uint32_t hitPercentDamage;
- bool isFriendly;
- int lastEmissionTime;
- ProjectileEmitterComponent(glm::vec2 projectileVelocity = glm::vec2 (0, 0), uint32_t repeatFrequency = 0,
- uint32_t projectileDuration = 10000,
- uint32_t hitPercentageDamage = 10,
- bool isFriendly= false) : projectileVelocity(projectileVelocity),
- repeatFrequency(repeatFrequency),
- projectileDuration(projectileDuration),
- hitPercentDamage(hitPercentageDamage),
- isFriendly(isFriendly)
- {
- this->lastEmissionTime = SDL_GetTicks();
- };
- };
- #endif /* GAMEENGINE_SOURCE_INCLUDE_COMPONENTS_PROJECTILEEMITTER_H */
|