This commit is contained in:
2025-11-26 09:22:52 +01:00
10 changed files with 165 additions and 25 deletions

View File

@@ -57,6 +57,8 @@ assets:
rooms:
- type: ROOM
path: ${PREFIX}/data/room/03.yaml
- type: ROOM
path: ${PREFIX}/data/room/04.yaml
# TILESETS
tilesets:

53
data/room/04.tmx Normal file
View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.11.2" orientation="orthogonal" renderorder="right-down" width="40" height="20" tilewidth="8" tileheight="8" infinite="0" nextlayerid="3" nextobjectid="1">
<tileset firstgid="1" source="//wsl.localhost/Debian/home/sergio/gitea/pollo/data/tilesets/standard.tsx"/>
<tileset firstgid="577" source="//wsl.localhost/Debian/home/sergio/gitea/pollo/data/tilesets/walls.tsx"/>
<layer id="1" name="Capa de patrones 1" width="40" height="20">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,34,34,0,0,0,0,0,
34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,142,0,0,0,0,0,0,34,0,0,0,0,0,0,
34,0,0,0,0,0,0,0,0,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,0,0,0,0,0,0,
34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,0,0,0,0,0,34,
34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,31,31,31,31,31,31,31,31,31,31,34,0,71,72,0,0,34,
34,31,31,31,31,31,31,31,31,31,31,31,31,0,0,0,0,0,0,0,0,0,0,260,0,0,0,0,0,0,260,0,0,34,0,95,96,0,0,34,
34,31,31,31,31,31,31,31,31,31,31,31,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,0,0,0,0,0,34,
34,31,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,
34,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,142,0,0,0,0,0,0,0,0,0,0,34,
34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,
34,0,0,0,0,0,0,0,0,0,0,0,142,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,
34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,365,365,365,365,365,365,365,365,365,34,
34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,175,175,175,175,0,0,0,0,0,0,293,293,293,293,293,293,293,293,293,34,
34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,263,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,
34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,
34,367,367,367,367,367,367,367,367,367,367,367,367,367,367,0,0,0,0,0,0,287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,
34,295,295,295,295,295,295,295,295,295,295,295,295,295,295,0,0,0,0,0,0,287,0,0,0,0,0,0,0,142,0,0,0,0,0,0,0,0,0,134,
34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,
34,0,0,0,0,381,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,311,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34
</data>
</layer>
<layer id="2" name="Capa de patrones 2" width="40" height="20">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,577,577,0,0,0,0,0,
577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,0,0,0,0,0,577,
577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,0,0,0,0,0,577,
577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,0,0,0,0,0,577,
577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,578,578,578,578,578,578,578,578,578,578,577,0,0,0,0,0,577,
577,577,577,577,577,577,577,577,577,577,577,577,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,0,0,0,0,0,577,
577,577,577,577,577,577,577,577,577,577,577,577,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,0,0,0,0,0,577,
577,577,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,
577,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,
577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,
577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,
577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,578,578,578,578,578,578,578,578,577,
577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,578,578,578,578,578,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,
577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,
577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,
577,578,578,578,578,578,578,578,578,578,578,578,578,578,578,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,
577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,
577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,
577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577,
577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577
</data>
</layer>
</map>

85
data/room/04.yaml Normal file
View File

@@ -0,0 +1,85 @@
# VOID MAIN
room:
name: "VOID MAIN"
bgColor: blue
border: mauve
tileSetFile: standard.gif
# Conexiones de la habitación (null = sin conexión)
connections:
up: null
down: null
left: null
right: null
# Colores de los objetos
itemColor1: magenta
itemColor2: pastel_magenta
# Dirección de la cinta transportadora: left, none, right
conveyorBelt: left
# Tilemap: 20 filas x 40 columnas (320x160 pixeles @ 8px/tile)
# Indices de tiles (-1 = vacio)
tilemap:
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, 33, 33, -1, -1, -1, -1, -1]
- [33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 141, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, -1]
- [33, -1, -1, -1, -1, -1, -1, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, -1]
- [33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, 33]
- [33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 33, -1, 70, 71, -1, -1, 33]
- [33, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 259, -1, -1, -1, -1, -1, -1, 259, -1, -1, 33, -1, 94, 95, -1, -1, 33]
- [33, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, 33]
- [33, 30, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33]
- [33, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 141, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33]
- [33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33]
- [33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 141, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33]
- [33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 364, 364, 364, 364, 364, 364, 364, 364, 364, 33]
- [33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 174, 174, 174, 174, 174, -1, -1, -1, -1, -1, -1, 292, 292, 292, 292, 292, 292, 292, 292, 292, 33]
- [33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 262, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33]
- [33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 286, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33]
- [33, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, -1, -1, -1, -1, -1, -1, 286, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 133]
- [33, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, -1, -1, -1, -1, -1, -1, 286, -1, -1, -1, -1, -1, -1, -1, 141, -1, -1, -1, -1, -1, -1, -1, -1, -1, 133]
- [33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 286, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33]
- [33, -1, -1, -1, -1, 380, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33]
- [33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33]
# Collisionmap: 20 filas x 40 columnas
# Indices de colision (-1 = vacio, 1 = solido, 2 = plataforma)
collisionmap:
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1]
- [1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1]
- [1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1]
- [1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1]
- [1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, -1, -1, -1, -1, -1, 1]
- [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1]
- [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1]
- [1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1]
- [1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1]
- [1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1]
- [1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1]
- [1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1]
- [1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 2, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1]
- [1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1]
- [1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1]
- [1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1]
- [1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1]
- [1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1]
- [1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1]
- [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
# Enemigos en esta habitación
enemies:
- animation: code.yaml
position: {x: 1, y: 17}
velocity: {x: 24.0, y: 0}
boundaries:
position1: {x: 1, y: 17}
position2: {x: 16, y: 17}
color: yellow
# Objetos en esta habitación
items:
- tileSetFile: items.gif
tile: 42
position: {x: 25, y: 7}
counter: 1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -17,7 +17,7 @@ namespace Defaults {
// Dimensiones del canvas del juego (usa GameCanvas como fuente única)
namespace Canvas {
constexpr int WIDTH = GameCanvas::WIDTH; // Ancho del canvas del juego (320)
constexpr int HEIGHT = GameCanvas::HEIGHT; // Alto del canvas del juego (240)
constexpr int HEIGHT = GameCanvas::HEIGHT; // Alto del canvas del juego (200)
} // namespace Canvas
// --- WINDOW ---
@@ -39,8 +39,8 @@ constexpr const char* PALETTE_NAME = "cpc"; // Paleta por defect
// --- BORDER ---
namespace Border {
constexpr bool ENABLED = true; // Borde activado por defecto
constexpr int WIDTH = 32; // Ancho del borde por defecto
constexpr int HEIGHT = 24; // Alto del borde por defecto
constexpr int WIDTH = 40; // Ancho del borde por defecto (400x300 total)
constexpr int HEIGHT = 50; // Alto del borde por defecto (400x300 total)
} // namespace Border
// --- AUDIO ---

View File

@@ -16,6 +16,10 @@
class Player {
public:
// --- Constantes de tamaño ---
static constexpr int WIDTH = 8; // Ancho del jugador en pixels
static constexpr int HEIGHT = 16; // Alto del jugador en pixels
// --- Enums y Structs ---
enum class State {
ON_GROUND, // En suelo plano o conveyor belt
@@ -72,10 +76,6 @@ class Player {
#endif
private:
// --- Constantes de tamaño ---
static constexpr int WIDTH = 8; // Ancho del jugador en pixels
static constexpr int HEIGHT = 16; // Alto del jugador en pixels
// --- Constantes de movimiento horizontal ---
static constexpr float WALK_VELOCITY = 50.0F; // Velocidad al caminar (inmediata) en pixels/segundo
static constexpr float RUN_VELOCITY = 80.0F; // Velocidad al correr en pixels/segundo

View File

@@ -41,7 +41,7 @@ class RoomLoader {
*
* El formato YAML esperado incluye:
* - room: configuración general
* - tilemap: array 2D de 24x40 tiles (convertido a vector 1D de 960 elementos)
* - tilemap: array 2D de 20x40 tiles (convertido a vector 1D de 800 elementos)
* - enemies: lista de enemigos (opcional)
* - items: lista de items (opcional)
*/
@@ -64,8 +64,8 @@ class RoomLoader {
/**
* @brief Convierte un tilemap 2D a vector 1D flat
* @param tilemap_2d Array 2D de tiles (24 rows × 40 cols)
* @return Vector 1D flat con 960 elementos
* @param tilemap_2d Array 2D de tiles (20 rows × 40 cols)
* @return Vector 1D flat con 800 elementos
*/
static auto flattenTilemap(const std::vector<std::vector<int>>& tilemap_2d) -> std::vector<int>;

View File

@@ -114,9 +114,9 @@ void Scoreboard::fillTexture() {
// Limpia la textura
surface_->clear(stringToColor("black"));
// Anclas
constexpr int LINE1 = Tile::SIZE;
constexpr int LINE2 = 3 * Tile::SIZE;
// Anclas (ajustadas para scoreboard de 40px)
constexpr int LINE1 = 6; // Reducido de 8 para ajuste proporcional
constexpr int LINE2 = 20; // Reducido de 24 para ajuste proporcional
// Dibuja las vidas
// Calcular desplazamiento basado en tiempo

View File

@@ -38,10 +38,10 @@ Game::Game(Mode mode)
room_tracker_(std::make_shared<RoomTracker>()),
mode_(mode),
#ifdef _DEBUG
current_room_("03.yaml"),
spawn_data_(Player::SpawnData(25 * Tile::SIZE, 21 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, Flip::LEFT))
current_room_("04.yaml"),
spawn_data_(Player::SpawnData(25 * Tile::SIZE, PlayArea::BOTTOM - Player::HEIGHT - Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, Flip::LEFT))
#else
current_room_("03.yaml"),
current_room_("04.yaml"),
spawn_data_(Player::SpawnData(25 * Tile::SIZE, 21 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, Flip::LEFT))
#endif
{

View File

@@ -10,7 +10,7 @@ constexpr int HALF_SIZE = SIZE / 2;
namespace GameCanvas {
constexpr int WIDTH = 320;
constexpr int HEIGHT = 240;
constexpr int HEIGHT = 200;
constexpr int CENTER_X = WIDTH / 2;
constexpr int FIRST_QUARTER_X = WIDTH / 4;
constexpr int THIRD_QUARTER_X = (WIDTH / 4) * 3;
@@ -26,22 +26,22 @@ constexpr int Y = 0;
// Dimensiones en tiles
constexpr int TILE_COLS = 40; // Ancho del mapa en tiles
constexpr int TILE_ROWS = 24; // Alto del mapa en tiles
constexpr int TILE_COUNT = TILE_COLS * TILE_ROWS; // 960 tiles totales
constexpr int TILE_ROWS = 20; // Alto del mapa en tiles
constexpr int TILE_COUNT = TILE_COLS * TILE_ROWS; // 800 tiles totales
// Dimensiones en pixels
constexpr int WIDTH = TILE_COLS * Tile::SIZE; // 320
constexpr int HEIGHT = TILE_ROWS * Tile::SIZE; // 192
constexpr int HEIGHT = TILE_ROWS * Tile::SIZE; // 160
// Bordes (derivados, útiles para colisiones)
constexpr int LEFT = X;
constexpr int TOP = Y;
constexpr int RIGHT = X + WIDTH; // 320
constexpr int BOTTOM = Y + HEIGHT; // 192
constexpr int BOTTOM = Y + HEIGHT; // 160
// Puntos de referencia
constexpr int CENTER_X = X + (WIDTH / 2); // 160
constexpr int CENTER_Y = Y + (HEIGHT / 2); // 96
constexpr int CENTER_Y = Y + (HEIGHT / 2); // 80
constexpr int QUARTER_X = WIDTH / 4;
constexpr int QUARTER_Y = HEIGHT / 4;
} // namespace PlayArea
@@ -49,17 +49,17 @@ constexpr int QUARTER_Y = HEIGHT / 4;
namespace ScoreboardArea {
// Origen (justo debajo de PlayArea)
constexpr int X = 0;
constexpr int Y = PlayArea::BOTTOM; // 192
constexpr int Y = PlayArea::BOTTOM; // 160
// Dimensiones
constexpr int WIDTH = GameCanvas::WIDTH; // 320
constexpr int HEIGHT = (6 * Tile::SIZE); // 48
constexpr int HEIGHT = (5 * Tile::SIZE); // 40
// Bordes
constexpr int LEFT = X;
constexpr int TOP = Y;
constexpr int RIGHT = X + WIDTH;
constexpr int BOTTOM = Y + HEIGHT; // 240
constexpr int BOTTOM = Y + HEIGHT; // 200
} // namespace ScoreboardArea
namespace Collision {