Cambios en los items y animatedsprite
This commit is contained in:
@@ -66,7 +66,7 @@ tileset=items.png
|
||||
tile=1
|
||||
x=9
|
||||
y=9
|
||||
counter=2
|
||||
counter=3
|
||||
[/item]
|
||||
|
||||
[item]
|
||||
@@ -82,7 +82,7 @@ tileset=items.png
|
||||
tile=1
|
||||
x=27
|
||||
y=9
|
||||
counter=2
|
||||
counter=3
|
||||
[/item]
|
||||
|
||||
[item]
|
||||
|
||||
@@ -91,7 +91,7 @@ void AnimatedSprite::setCurrentFrame(int num)
|
||||
}
|
||||
|
||||
// Cambia el valor de la variable
|
||||
animation[currentAnimation].currentFrame = num;
|
||||
animation[currentAnimation].counter = animation[currentAnimation].speed * num;
|
||||
|
||||
// Escoge el frame correspondiente de la animación
|
||||
setSpriteClip(animation[currentAnimation].frames[animation[currentAnimation].currentFrame]);
|
||||
|
||||
@@ -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
|
||||
|
||||
6
todo.txt
6
todo.txt
@@ -16,7 +16,7 @@ x (A) Morir al caer de alto
|
||||
x (A) Crear ascensores (NO SE VA A HACER POR DISEÑO)
|
||||
x (A) Crear rampas
|
||||
x (A) Enemigos de diferente tamaño {cm:2022-08-30}
|
||||
(A) Color de los items al estilo jet set willy de amstrad, que brillan con dos colores
|
||||
x (A) Color de los items al estilo jet set willy de amstrad, que brillan con dos colores
|
||||
x (A) Temporizador de inicio de los items, para poder hacer que brillen a distinto ritmo. Esto es incompatible con lo anterior {cm:2022-08-30}
|
||||
x (A) Crear efecto de fade estilo spectrum, cambiando el color de las cosas a rojo, morado, azul, negro
|
||||
x (A) Hacer que los enemigos tengan flip
|
||||
@@ -42,10 +42,10 @@ x (A) La pantalla de titulo no tiene menu, solo un PRESS ENTER TO PLAY
|
||||
(A) La musica del titulo ha de seguir sonando en los creditos y el ¿logo?
|
||||
(A) Menu de pausa/salir
|
||||
x (A) Poner el mapa/jugador en pausa
|
||||
(A) El color del borde se pierde al morir por la pantalla negra
|
||||
x (A) El color del borde se pierde al morir por la pantalla negra
|
||||
|
||||
(B) El fichero ani ha de calcular cuantos frames hay a partir del tamaño y ver que no hay ningun indice incorrecto
|
||||
(B) Así como no necesitar lo de frames per roomDown
|
||||
x (B) Así como no necesitar lo de frames per row
|
||||
(B) Le ha de pasar el w y h al sprite
|
||||
(B) Lo enemigos han de coger el ancho y alto del fichero ani (y si no hay?)
|
||||
(B) Si no se passa parametro, el fichero ani se deduce del png (y si no hay?)
|
||||
|
||||
Reference in New Issue
Block a user