Projectile.h 966 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * 2D Game Engine
  3. * Projectile.h:
  4. * Based on pikuma.com 2D game engine in C++ and Lua course
  5. * Copyright (c) 2021 986-Studio. All rights reserved.
  6. *
  7. * Created by Manoël Trapier on 27/02/2021.
  8. */
  9. #ifndef GAMEENGINE_SOURCE_INCLUDE_COMPONENTS_PROJECTILE_H
  10. #define GAMEENGINE_SOURCE_INCLUDE_COMPONENTS_PROJECTILE_H
  11. #include <SDL.h>
  12. struct ProjectileComponent
  13. {
  14. uint32_t projectileDuration;
  15. uint32_t hitPercentDamage;
  16. bool isFriendly;
  17. uint32_t startTime;
  18. ProjectileComponent(uint32_t projectileDuration = 0,
  19. uint32_t hitPercentDamage = 0,
  20. bool isFriendly = false) : projectileDuration(projectileDuration),
  21. hitPercentDamage(hitPercentDamage),
  22. isFriendly(isFriendly)
  23. {
  24. this->startTime = SDL_GetTicks();
  25. }
  26. };
  27. #endif /* GAMEENGINE_SOURCE_INCLUDE_COMPONENTS_PROJECTILE_H */