forked from jaildesigner-jailgames/jaildoctors_dilemma
Cambios en los items y animatedsprite
This commit is contained in:
@@ -5,43 +5,38 @@
|
||||
// Constructor
|
||||
Item::Item(item_t item)
|
||||
{
|
||||
const int itemSize = 8;
|
||||
|
||||
// Obten punteros a objetos
|
||||
asset = item.asset;
|
||||
renderer = item.renderer;
|
||||
|
||||
// Crea objetos
|
||||
texture = new LTexture(renderer, asset->get(item.tileset));
|
||||
sprite = new Sprite(item.x, item.y, 8, 8, texture, renderer);
|
||||
sprite = new Sprite(item.x, item.y, itemSize, itemSize, texture, renderer);
|
||||
|
||||
// Inicia variables
|
||||
sprite->setSpriteClip((item.tile % 10) * 8, (item.tile / 10) * 8, 8, 8);
|
||||
sprite->setSpriteClip((item.tile % 10) * itemSize, (item.tile / 10) * itemSize, itemSize, itemSize);
|
||||
collider = sprite->getRect();
|
||||
colorChangeSpeed = 8;
|
||||
colorChangeSpeed = 4;
|
||||
counter = item.counter * colorChangeSpeed;
|
||||
|
||||
// Inicializa los colores
|
||||
color_t c = item.color1;
|
||||
color.push_back(c);
|
||||
color.push_back(c);
|
||||
|
||||
c = item.color2;
|
||||
color.push_back(c);
|
||||
/*color_t c = stringToColor("blue");
|
||||
color.push_back(c);
|
||||
|
||||
c = stringToColor("red");
|
||||
color.push_back(c);
|
||||
|
||||
c = stringToColor("magenta");
|
||||
color.push_back(c);
|
||||
|
||||
c = stringToColor("green");
|
||||
color.push_back(c);
|
||||
|
||||
c = stringToColor("cyan");
|
||||
color.push_back(c);
|
||||
|
||||
c = stringToColor("yellow");
|
||||
color.push_back(c);*/
|
||||
/*
|
||||
const std::vector<std::string> vColors = {"blue", "red", "magenta", "green", "cyan", "yellow"};
|
||||
for (auto v:vColors)
|
||||
{
|
||||
color.push_back(stringToColor(v));
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// Destructor
|
||||
|
||||
Reference in New Issue
Block a user