-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic member functions to character (#12)
* Add basic member functions to character Remove bot and weapon name from states Remove texture maps Remove unnecessary dependencies * Fix threading problem and make weapon states synchronized with game clock * Remove hardcoded style from texture manager * Add middle class for enemy state for enemy specific members * Update animation * Create single ray caster service for bots * Add object id field in ray * Move camera into player instead of having them separate * Create shooting manager * Update enemy states and use shooting logic
- Loading branch information
Showing
40 changed files
with
1,164 additions
and
619 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* @file single_raycaster.h | ||
* @author Bilal Kahraman ([email protected]) | ||
* @brief | ||
* @version 0.1 | ||
* @date 2024-11-05 | ||
* | ||
* @copyright Copyright (c) 2024 | ||
* | ||
*/ | ||
|
||
#ifndef CAMERA_INCLUDE_CAMERA_SINGLE_RAYCASTER_H_ | ||
#define CAMERA_INCLUDE_CAMERA_SINGLE_RAYCASTER_H_ | ||
|
||
#include "Camera/ray.h" | ||
#include "Map/map.h" | ||
#include "Math/vector.h" | ||
|
||
#include <memory> | ||
|
||
namespace wolfenstein { | ||
|
||
class SingleRayCasterService | ||
{ | ||
public: | ||
static SingleRayCasterService& GetInstance(); | ||
SingleRayCasterService(const SingleRayCasterService&) = delete; | ||
SingleRayCasterService& operator=(const SingleRayCasterService&) = delete; | ||
~SingleRayCasterService() = default; | ||
|
||
void InitService(const std::shared_ptr<Map>& map_ptr); | ||
Ray Cast(const vector2d& src); | ||
|
||
void SubscribePlayerPose(const vector2d& pose); | ||
|
||
private: | ||
SingleRayCasterService() = default; | ||
|
||
void PrepareRay(const vector2d& src, Ray& ray, vector2d& ray_unit_step, | ||
vector2d& ray_length_1d, vector2i& step, | ||
vector2i& map_check); | ||
|
||
vector2d dest{0, 0}; | ||
std::shared_ptr<Map> map_ptr_; | ||
static SingleRayCasterService* instance_; | ||
}; | ||
|
||
} // namespace wolfenstein | ||
|
||
#endif // CAMERA_INCLUDE_CAMERA_SINGLE_RAYCASTER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.