Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F86309
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
8 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/SRC/AlmacenDeGraficos.cpp b/SRC/AlmacenDeGraficos.cpp
index 08feafe..72c0dca 100644
--- a/SRC/AlmacenDeGraficos.cpp
+++ b/SRC/AlmacenDeGraficos.cpp
@@ -1,64 +1,64 @@
#include "AlmacenDeGraficos.hpp"
#include "Tablero.hpp"
AlmacenDeGraficos::AlmacenDeGraficos()
{
cargarSpritesPacman();
cargarSpritesFantasma();
cargarPuntos();
}
void AlmacenDeGraficos::cargarSpritesPacman()
{
sf::Image imagen;
- imagen.loadFromFile("./Sprites/pacman.png");
+ imagen.loadFromFile("/usr/share/comecocos/Sprites/pacman.png");
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 2; j++) // dos animaciones por fotograma
{
jugador[i][j].loadFromImage(imagen,sf::IntRect(j*Tablero::ESCALA+i*Tablero::ESCALA*2,0,Tablero::ESCALA,Tablero::ESCALA));
// Personaje::textura[i][j] = &textura[i][j];
}
}
for (int i = 0;i<11;i++)
{
muerto_jugador[i].loadFromImage(imagen,sf::IntRect(i*Tablero::ESCALA,Tablero::ESCALA,Tablero::ESCALA,Tablero::ESCALA));
}
}
void AlmacenDeGraficos::cargarSpritesFantasma()
{
sf::Image imagen;
- imagen.loadFromFile("./Sprites/Fantasma.png");
+ imagen.loadFromFile("/usr/share/comecocos/Sprites/Fantasma.png");
for (int i = 0; i < 4; i++) // 4 fantasmas
{
for (int j = 0; j < 4; j++) // 4 dirreciones
{
for (int k = 0; k < 2; k++) // 2 fotogramas
{
fantasma[i][j][k].loadFromImage(imagen,sf::IntRect(j*40+k*Tablero::ESCALA,i*Tablero::ESCALA,Tablero::ESCALA,Tablero::ESCALA));
}
}
muerto_fantasma[i].loadFromImage(imagen,sf::IntRect(80+Tablero::ESCALA*i,80,Tablero::ESCALA,Tablero::ESCALA));
//Muerto[i].setTexture(Muerto_Texture[i]);
panico_fantasma[i].loadFromImage(imagen,sf::IntRect(i*Tablero::ESCALA,80,Tablero::ESCALA,Tablero::ESCALA));
//Panico_Final[i].setTexture(Panico_Texture[i]);
}
}
void AlmacenDeGraficos::cargarPuntos()
{
sf::Image imagen;
- imagen.loadFromFile("./Image/Puntuacion.png");
+ imagen.loadFromFile("/usr/share/comecocos/Image/Puntuacion.png");
for (int i = 0;i<4;i++)
{
puntos[i].loadFromImage(imagen,sf::IntRect(i*20,0,20,20));
}
}
diff --git a/SRC/AlmacenDeSonido.cpp b/SRC/AlmacenDeSonido.cpp
index 6b43b74..5a0f1c6 100644
--- a/SRC/AlmacenDeSonido.cpp
+++ b/SRC/AlmacenDeSonido.cpp
@@ -1,11 +1,11 @@
#include "AlmacenDeSonido.hpp"
AlmacenDeSonido::AlmacenDeSonido()
{
//ctor
- pacman_beginning.loadFromFile("./Sound/pacman_beginning.wav");
- pacman_death.loadFromFile("./Sound/pacman_death.wav");
- pacman_eatfruit.loadFromFile("./Sound/pacman_eatfruit.wav");
- pacman_rampage.loadFromFile("./Sound/pacman_rampage.wav");
+ pacman_beginning.loadFromFile("/usr/share/comecocos/Sound/pacman_beginning.wav");
+ pacman_death.loadFromFile("/usr/share/comecocos/Sound/pacman_death.wav");
+ pacman_eatfruit.loadFromFile("/usr/share/comecocos/Sound/pacman_eatfruit.wav");
+ pacman_rampage.loadFromFile("/usr/share/comecocos/Sound/pacman_rampage.wav");
}
diff --git a/SRC/Tablero.cpp b/SRC/Tablero.cpp
index f7b53f0..62477f6 100644
--- a/SRC/Tablero.cpp
+++ b/SRC/Tablero.cpp
@@ -1,139 +1,139 @@
#include "Tablero.hpp"
#include "Puntuacion.hpp"
const char mapa_orig[Tablero::Tamanyo_Mapa_Y][Tablero::Tamanyo_Mapa_X]={
{"xxxxxxxxxxxxxxxxxxxxxxxxxxxx"},
{"xccccccccccccxxccccccccccccx"},
{"xcxxxxcxxxxxcxxcxxxxxcxxxxcx"},
{"xCx xcx xcxxcx xcx xCx"},
/* Fxla 5 */ {"xcxxxxcxxxxxcxxcxxxxxcxxxxcx"},
{"xccccccccccccccccccccccccccx"},
{"xcxxxxcxxcxxxxxxxxcxxcxxxxcx"},
{"xcxxxxcxxcxxxxxxxxcxxcxxxxcx"},
{"xccccccxxccccxxccccxxccccccx"},
/* Fxla 10 */ {"xxxxxxcxxxxxcxxcxxxxxcxxxxxx"},
{" xcxxxxxcxxcxxxxxcx "},
{" xcxx xxcx "},
{" xcxx xxx xxx xxcx "},
{"xxxxxxcxx x x xxcxxxxxx"},
/* Fxla 15 */ {" c x x c "},
{"xxxxxxcxx x x xxcxxxxxx"},
{" xcxx xxxxxxxx xxcx "},
{" xcxx xxcx "},
{" xcxx xxxxxxxx xxcx "},
/* Fxla 20 */ {"xxxxxxcxx xxxxxxxx xxcxxxxxx"},
{"xccccccccccccxxccccccccccccx"},
{"xcxxxxcxxxxxcxxcxxxxxcxxxxcx"},
{"xcxxxxcxxxxxcxxcxxxxxcxxxxcx"},
{"xCccxxccccccc ccccccccxxccCx"},
/* Fxla 25 */ {"xxxcxxcxxcxxxxxxxxcxxcxxcxxx"},
{"xxxcxxcxxcxxxxxxxxcxxcxxcxxx"},
{"xccccccxxccccxxccccxxccccccx"},
{"xcxxxxxxxxxxcxxcxxxxxxxxxxcx"},
{"xcxxxxxxxxxxcxxcxxxxxxxxxxcx"},
/* Fxla 30 */ {"xccccccccccccccccccccccccccx"},
{"xxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
};
Tablero::Tablero(const int resolucionx,const int resoluciony,Puntuacion& p)
: RESOLUCION(resolucionx,resoluciony),puntuacion(p)
{
//ctor
for (int i = 0;i<Tamanyo_Mapa_Y;i++)
{
for (int j = 0;j<Tamanyo_Mapa_X;j++)
{
mapa[i][j] = mapa_orig[i][j];
}
}
- campo.loadFromFile("./Image/Nivel.png");
+ campo.loadFromFile("/usr/share/comecocos/Image/Nivel.png");
campo_con_la_comida.create(resolucionx,resoluciony);
comida_representacion.setRadius(ESCALA/4);
comida_representacion.setFillColor(sf::Color::Yellow);
pildora_representacion.setRadius(ESCALA/4+2);
pildora_representacion.setFillColor(sf::Color::Red);
generarRepresentacion();
}
void Tablero::generarRepresentacion()
{
campo_con_la_comida.clear();
campo_con_la_comida.draw(sf::Sprite(campo));
comida = 0;
for (int i = 0;i<Tamanyo_Mapa_X;i++)
{
for (int j = 0;j<Tamanyo_Mapa_Y;j++)
{
if (esComida(i,j))
{
comida++;
comida_representacion.setPosition(i*ESCALA+ESCALA/4,j*ESCALA+ESCALA/4);
campo_con_la_comida.draw(comida_representacion);
}
else if (esPildora(i,j))
{
comida++;
pildora_representacion.setPosition(i*ESCALA+ESCALA/4-2,j*ESCALA+ESCALA/4-2);
campo_con_la_comida.draw(pildora_representacion);
}
}
}
campo_con_la_comida.display();
sprite.setTexture(campo_con_la_comida.getTexture());
}
bool Tablero::esComida(int x,int y) const
{
return mapa[y][x] == 'c';
}
bool Tablero::esPildora(int x,int y) const
{
return mapa[y][x] == 'C';
}
bool Tablero::comible(int x,int y) const
{
return esComida(x,y) || esPildora(x,y);
}
int Tablero::comer(int x,int y)
{
if (esPared(x,y)) return 0;
else
{
if (comible(x,y))
{
//puntos++;
comida--;
if (esPildora(x,y))
{
puntuacion.comerPildora();
borrarComida(x,y);
return -1;
}
else
{
puntuacion.comerComida();
borrarComida(x,y);
}
return 1;
}
return 0;
}
}
void Tablero::borrarComida(int x,int y)
{
mapa[y][x] = ' ';
generarRepresentacion();
}
diff --git a/debian/changelog b/debian/changelog
index 36cbe74..97ccced 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,17 @@
+comecocos (1.0-3) groovy; urgency=medium
+
+ * Fix asset paths
+
+ -- Chris <dpkg@chris-nz.com> Wed, 07 Apr 2021 01:21:59 +1200
+
comecocos (1.0-2) groovy; urgency=medium
* Fix typo in man page, so rebuild package
-- Chris <dpkg@chris-nz.com> Mon, 05 Apr 2021 16:37:37 +1200
comecocos (1.0-1) groovy; urgency=medium
* Initial release for groovy
-- Chris <dpkg@chris-nz.com> Sun, 04 Apr 2021 19:43:00 +1300
diff --git a/debian/patches/series b/debian/patches/series
index 90c15cc..895c66a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
Change-Name-of-Release-Binary
Use-system-Liberation-font-instead-of-bundled-Arial
+fix-asset-paths-and-extra-bits
diff --git a/debian/source/include-binaries b/debian/source/include-binaries
index 6a4fcd8..7333782 100644
--- a/debian/source/include-binaries
+++ b/debian/source/include-binaries
@@ -1,18 +1,19 @@
debian/data/comecocos.png
debian/data/comecocos.desktop
comecocos
obj/Release/SRC/AlmacenDeFuentes.o
obj/Release/SRC/AlmacenDeGraficos.o
obj/Release/SRC/AlmacenDeSonido.o
obj/Release/SRC/Estado.o
obj/Release/SRC/Fantasma.o
obj/Release/SRC/FantasmaAmarillo.o
obj/Release/SRC/FantasmaAzul.o
obj/Release/SRC/FantasmaRojo.o
obj/Release/SRC/FantasmaRosa.o
obj/Release/SRC/Pacman.o
obj/Release/SRC/Personaje.o
obj/Release/SRC/Puntuacion.o
obj/Release/SRC/Tablero.o
obj/Release/SRC/main.o
+../../../../dev/null
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Sep 12, 6:20 AM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42830
Default Alt Text
(8 KB)
Attached To
Mode
R73 Comecocos
Attached
Detach File
Event Timeline
Log In to Comment