mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 09:54:10 +03:00
Move entityclass::setblockcolour() to blockclass::setblockcolour()
This moves the function setblockcolour(), so I can directly call it on a particular block without having to have it be inside obj.blocks.
This commit is contained in:
@@ -34,3 +34,68 @@ void blockclass::rectset(const int xi, const int yi, const int wi, const int hi)
|
||||
rect.w = wi;
|
||||
rect.h = hi;
|
||||
}
|
||||
|
||||
void blockclass::setblockcolour( std::string col )
|
||||
{
|
||||
if (col == "cyan")
|
||||
{
|
||||
r = 164;
|
||||
g = 164;
|
||||
b = 255;
|
||||
}
|
||||
else if (col == "red")
|
||||
{
|
||||
r = 255;
|
||||
g = 60;
|
||||
b = 60;
|
||||
}
|
||||
else if (col == "green")
|
||||
{
|
||||
r = 144;
|
||||
g = 255;
|
||||
b = 144;
|
||||
}
|
||||
else if (col == "yellow")
|
||||
{
|
||||
r = 255;
|
||||
g = 255;
|
||||
b = 134;
|
||||
}
|
||||
else if (col == "blue")
|
||||
{
|
||||
r = 95;
|
||||
g = 95;
|
||||
b = 255;
|
||||
}
|
||||
else if (col == "purple")
|
||||
{
|
||||
r = 255;
|
||||
g = 134;
|
||||
b = 255;
|
||||
}
|
||||
else if (col == "white")
|
||||
{
|
||||
r = 244;
|
||||
g = 244;
|
||||
b = 244;
|
||||
}
|
||||
else if (col == "gray")
|
||||
{
|
||||
r = 174;
|
||||
g = 174;
|
||||
b = 174;
|
||||
}
|
||||
else if (col == "orange")
|
||||
{
|
||||
r = 255;
|
||||
g = 130;
|
||||
b = 20;
|
||||
}
|
||||
else
|
||||
{
|
||||
//use a gray
|
||||
r = 174;
|
||||
g = 174;
|
||||
b = 174;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user