add standard white & dark colors in ShooterConsts.h

master
Vectozavr 2021-11-07 14:47:24 +07:00
parent fbc129d143
commit e1cd619eef
4 changed files with 29 additions and 15 deletions

View File

@ -279,14 +279,12 @@ void Shooter::spawnPlayer(sf::Uint16 id) {
Vec3D randColor1 = Vec3D::Random();
Vec3D randColor2 = Vec3D::Random();
newPlayer->setColor({static_cast<sf::Uint8>(randColor1.x() * 255), static_cast<sf::Uint8>(randColor1.y() * 255),
static_cast<sf::Uint8>(randColor1.z() * 255)});
world->body(ObjectNameTag(name + "_foot_1"))->setColor(
{static_cast<sf::Uint8>(randColor2.x() * 255), static_cast<sf::Uint8>(randColor2.y() * 255),
static_cast<sf::Uint8>(randColor2.z() * 255)});
world->body(ObjectNameTag(name + "_foot_2"))->setColor(
{static_cast<sf::Uint8>(randColor2.x() * 255), static_cast<sf::Uint8>(randColor2.y() * 255),
static_cast<sf::Uint8>(randColor2.z() * 255)});
int colorBodyNum = (int) ((double) (rand()-1) / RAND_MAX * 5);
int colorFootNum = (int) ((double) (rand()-1) / RAND_MAX * 5);
newPlayer->setColor(ShooterConsts::WHITE_COLORS[colorBodyNum]);
world->body(ObjectNameTag(name + "_foot_1"))->setColor(ShooterConsts::DARK_COLORS[colorFootNum]);
world->body(ObjectNameTag(name + "_foot_2"))->setColor(ShooterConsts::DARK_COLORS[colorFootNum]);
changeEnemyWeapon("gun", id);
}

View File

@ -76,17 +76,17 @@ void ShooterClient::processUpdate(sf::Packet &packet) {
if(isAnimate) {
if(foot1 != nullptr && foot2 != nullptr && !Timeline::isInAnimList(AnimationListTag(name + "_foot1_rotation"))) {
Timeline::animate(AnimationListTag(name + "_foot1_rotation"), std::make_shared<ARotateLeft>(foot1, 0.4, 0.2, Animation::LoopOut::None, Animation::InterpolationType::Linear));
Timeline::animate(AnimationListTag(name + "_foot1_rotation"), std::make_shared<ARotateLeft>(foot1, 0.6, 0.2, Animation::LoopOut::None, Animation::InterpolationType::Linear));
Timeline::animate(AnimationListTag(name + "_foot1_rotation"), std::make_shared<AWait>(0));
Timeline::animate(AnimationListTag(name + "_foot1_rotation"), std::make_shared<ARotateLeft>(foot1, -0.8, 0.2, Animation::LoopOut::None, Animation::InterpolationType::Linear));
Timeline::animate(AnimationListTag(name + "_foot1_rotation"), std::make_shared<ARotateLeft>(foot1, -1.2, 0.2, Animation::LoopOut::None, Animation::InterpolationType::Linear));
Timeline::animate(AnimationListTag(name + "_foot1_rotation"), std::make_shared<AWait>(0));
Timeline::animate(AnimationListTag(name + "_foot1_rotation"), std::make_shared<ARotateLeft>(foot1, 0.4, 0.2, Animation::LoopOut::None, Animation::InterpolationType::Linear));
Timeline::animate(AnimationListTag(name + "_foot1_rotation"), std::make_shared<ARotateLeft>(foot1, 0.6, 0.2, Animation::LoopOut::None, Animation::InterpolationType::Linear));
Timeline::animate(AnimationListTag(name + "_foot2_rotation"), std::make_shared<ARotateLeft>(foot2, -0.4, 0.2, Animation::LoopOut::None, Animation::InterpolationType::Linear));
Timeline::animate(AnimationListTag(name + "_foot2_rotation"), std::make_shared<ARotateLeft>(foot2, -0.6, 0.2, Animation::LoopOut::None, Animation::InterpolationType::Linear));
Timeline::animate(AnimationListTag(name + "_foot2_rotation"), std::make_shared<AWait>(0));
Timeline::animate(AnimationListTag(name + "_foot2_rotation"), std::make_shared<ARotateLeft>(foot2, 0.8, 0.2, Animation::LoopOut::None, Animation::InterpolationType::Linear));
Timeline::animate(AnimationListTag(name + "_foot2_rotation"), std::make_shared<ARotateLeft>(foot2, 1.2, 0.2, Animation::LoopOut::None, Animation::InterpolationType::Linear));
Timeline::animate(AnimationListTag(name + "_foot2_rotation"), std::make_shared<AWait>(0));
Timeline::animate(AnimationListTag(name + "_foot2_rotation"), std::make_shared<ARotateLeft>(foot2, -0.4, 0.2, Animation::LoopOut::None, Animation::InterpolationType::Linear));
Timeline::animate(AnimationListTag(name + "_foot2_rotation"), std::make_shared<ARotateLeft>(foot2, -0.6, 0.2, Animation::LoopOut::None, Animation::InterpolationType::Linear));
}
}

View File

@ -57,6 +57,22 @@ namespace ShooterConsts {
const std::string SLOW_MO_SOUND = "sound/slow_mo.ogg";
const std::string UN_SLOW_MO_SOUND = "sound/unslow_mo.ogg";
const std::string NO_AMMO_SOUND = "sound/weapons/no_ammo.ogg";
const sf::Color WHITE_COLORS[] = {
sf::Color(137, 135, 222), // blue
sf::Color(195, 155, 209), // pink
sf::Color(201, 137, 137), // red
sf::Color(116, 204, 135), // green
sf::Color(201, 171, 137), // orange
};
const sf::Color DARK_COLORS[] = {
sf::Color(16, 18, 69), // blue
sf::Color(77, 0, 62), // pink
sf::Color(99, 20, 20), // red
sf::Color(12, 46, 9), // green
sf::Color(97, 70, 51), // orange
};
}
#endif //SHOOTER_SHOOTERCONSTS_H

View File

@ -1,6 +1,6 @@
m 000 255 213 196 255
m 001 43 64 59 255
m 002 54 75 161 255
m 002 160 158 255 255
m 003 166 101 103 255
m 004 205 157 154 255
o Cube