simple color coded unit models

This commit is contained in:
devZoGok
2024-06-29 11:52:07 +03:00
parent fc6751db01
commit b087238fbb
5 changed files with 42 additions and 5 deletions
+19 -2
View File
@@ -12,9 +12,26 @@ namespace battleship{
using namespace gameBase;
using namespace std;
Player::Player(int diff, int fac, int t, Vector3 col, bool cpuPl, Vector3 sp, string n) : difficulty(diff), faction(fac), team(t), color(col), cpuPlayer(cpuPl), spawnPoint(sp), name("pl"), refineds(30000), trader(new Trader()) {}
Player::Player(int diff, int fac, int t, Vector3 col, bool cpuPl, Vector3 sp, string n) :
difficulty(diff),
faction(fac),
team(t),
color(col),
cpuPlayer(cpuPl),
spawnPoint(sp),
name("pl"),
refineds(30000),
trader(new Trader())
{
colorMaterial = new Material(Root::getSingleton()->getLibPath() + "texture");
colorMaterial->addBoolUniform("lightingEnabled", false);
colorMaterial->addBoolUniform("texturingEnabled", false);
colorMaterial->addVec4Uniform("diffuseColor", Vector4(color.x, color.y, color.z, 1));
}
Player::~Player() {}
Player::~Player() {
delete colorMaterial;
}
void Player::update() {
trader->update();