bug fixed with respawn animation
parent
943253b1bc
commit
2e926a10f4
|
@ -123,9 +123,8 @@ void ShooterClient::processCustomPacket(sf::Packet &packet) {
|
||||||
|
|
||||||
_player->unattach(ObjectNameTag("Camera"));
|
_player->unattach(ObjectNameTag("Camera"));
|
||||||
_player->translateToPoint(Vec3D{10000});
|
_player->translateToPoint(Vec3D{10000});
|
||||||
Vec2D cameraOrientation(camera->angleLeftUpLookAt().x(), _player->angle().y());
|
camera->rotateLeft(-camera->angleLeftUpLookAt().x());
|
||||||
camera->rotateLeft(-cameraOrientation.x());
|
camera->transform(Matrix4x4::Rotation(-_player->angle()));
|
||||||
camera->transform(Matrix4x4::Rotation(Vec3D(-_player->angle())));
|
|
||||||
|
|
||||||
Timeline::animate(AnimationListTag("camera_anim"), std::make_shared<ATranslateToPoint>(camera, Vec3D(-20, 30, -100)));
|
Timeline::animate(AnimationListTag("camera_anim"), std::make_shared<ATranslateToPoint>(camera, Vec3D(-20, 30, -100)));
|
||||||
Timeline::animate(AnimationListTag("camera_anim"), std::make_shared<ARotateRelativePoint>(camera, Vec3D(0), Vec3D{0, Consts::PI, 0}, 5, Animation::LoopOut::None, Animation::InterpolationType::Linear));
|
Timeline::animate(AnimationListTag("camera_anim"), std::make_shared<ARotateRelativePoint>(camera, Vec3D(0), Vec3D{0, Consts::PI, 0}, 5, Animation::LoopOut::None, Animation::InterpolationType::Linear));
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace ShooterConsts {
|
||||||
const std::string SHOTGUN_RELOAD_SOUND = "sound/weapons/reload_shotgun.ogg";
|
const std::string SHOTGUN_RELOAD_SOUND = "sound/weapons/reload_shotgun.ogg";
|
||||||
|
|
||||||
const std::string CUBE_OBJ = "obj/cube.obj";
|
const std::string CUBE_OBJ = "obj/cube.obj";
|
||||||
const std::string MAP_OBJ = "maps/map.obj";
|
const std::string MAP_OBJ = "maps/map2.obj";
|
||||||
const std::string MAIN_MENU_BACK = "textures/back.png";
|
const std::string MAIN_MENU_BACK = "textures/back.png";
|
||||||
const std::string MAIN_MENU_GUI = "textures/gui.png";
|
const std::string MAIN_MENU_GUI = "textures/gui.png";
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,10 @@ using namespace std;
|
||||||
int main() {
|
int main() {
|
||||||
Shooter game;
|
Shooter game;
|
||||||
|
|
||||||
//game.create(1280, 720, ShooterConsts::PROJECT_NAME);
|
game.create(1280, 720, ShooterConsts::PROJECT_NAME);
|
||||||
//game.create(1920, 1080, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen);
|
//game.create(1920, 1080, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen);
|
||||||
|
|
||||||
game.create(2048, 1152, ShooterConsts::PROJECT_NAME, true);
|
//game.create(2048, 1152, ShooterConsts::PROJECT_NAME, true);
|
||||||
//game.create(3072, 1920, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen);
|
//game.create(3072, 1920, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -16,7 +16,7 @@ private:
|
||||||
const std::function<void()> _callBack;
|
const std::function<void()> _callBack;
|
||||||
|
|
||||||
void update() override {
|
void update() override {
|
||||||
if (_allCalls != 0 && progress() >= (double) (_callsCounter + 1) / (_allCalls + 1)) {
|
if (_allCalls != 0 && progress() > (double) _callsCounter / _allCalls) {
|
||||||
_callsCounter++;
|
_callsCounter++;
|
||||||
_callBack();
|
_callBack();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue