diff --git a/data/test.gif b/data/test.gif index 5dc8a9b..e0596d8 100644 Binary files a/data/test.gif and b/data/test.gif differ diff --git a/source/main.cpp b/source/main.cpp index 34ad9e1..d8669f5 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -13,11 +13,12 @@ int room_xp = -1; int room_xn = -1; int room_yp = -1; int room_yn = -1; +int room_color = 5; void restart() { actor::clear(); - room::load(room_w, room_h, room_xp, room_xn, room_yp, room_yn); + room::load(room_w, room_h, room_xp, room_xn, room_yp, room_yn, room_color); /* box = actor::create("ASCENSOR",{16,32,0}, {8,8,4}, {64,0,32,24}, {0,24}); @@ -113,6 +114,7 @@ bool game::loop() btn("DOOR XN:", 330, 65, room_xn, -1, 5); btn("DOOR YP:", 330, 80, room_yp, -1, 5); btn("DOOR YN:", 330, 95, room_yn, -1, 5); + btn("COLOR:", 330, 110, room_color, 3, 7); draw::render(); diff --git a/source/room.cpp b/source/room.cpp index 01108c2..ad74022 100644 --- a/source/room.cpp +++ b/source/room.cpp @@ -12,9 +12,11 @@ namespace room static uint8_t doors = DOOR_XP /*| DOOR_YP*/ ; static uint8_t door_height[4]; + static uint8_t color = 5; - void load(int x, int y, int8_t xp, int8_t xn, int8_t yp, int8_t yn) + void load(int x, int y, int8_t xp, int8_t xn, int8_t yp, int8_t yn, uint8_t col) { + color = col; size = {(x+1)*2,(y+1)*2,3}; tmin = {3-x,3-y,0}; tmax = {4+x,4+y,3}; @@ -49,6 +51,8 @@ namespace room void draw() { + draw::swapcol(1, color); + // RUTINES DE PINTAT DE LA PORTA DE DALT A LA DRETA if (doors & DOOR_YN) { @@ -112,6 +116,8 @@ namespace room void draw2() { + draw::swapcol(1, color); + if (doors & DOOR_YP) { // Pintem les voreres dels dos tiles extra per a la porta YP diff --git a/source/room.h b/source/room.h index e57f36f..3de3784 100644 --- a/source/room.h +++ b/source/room.h @@ -13,7 +13,7 @@ namespace room { - void load(int x, int y, int8_t xp, int8_t xn, int8_t yp, int8_t yn); + void load(int x, int y, int8_t xp, int8_t xn, int8_t yp, int8_t yn, uint8_t col); void draw(); void draw2();