- Es pot canviar el color de l'habitació
This commit is contained in:
BIN
data/test.gif
BIN
data/test.gif
Binary file not shown.
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.7 KiB |
@@ -13,11 +13,12 @@ int room_xp = -1;
|
|||||||
int room_xn = -1;
|
int room_xn = -1;
|
||||||
int room_yp = -1;
|
int room_yp = -1;
|
||||||
int room_yn = -1;
|
int room_yn = -1;
|
||||||
|
int room_color = 5;
|
||||||
|
|
||||||
void restart()
|
void restart()
|
||||||
{
|
{
|
||||||
actor::clear();
|
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});
|
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 XN:", 330, 65, room_xn, -1, 5);
|
||||||
btn("DOOR YP:", 330, 80, room_yp, -1, 5);
|
btn("DOOR YP:", 330, 80, room_yp, -1, 5);
|
||||||
btn("DOOR YN:", 330, 95, room_yn, -1, 5);
|
btn("DOOR YN:", 330, 95, room_yn, -1, 5);
|
||||||
|
btn("COLOR:", 330, 110, room_color, 3, 7);
|
||||||
|
|
||||||
draw::render();
|
draw::render();
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,11 @@ namespace room
|
|||||||
|
|
||||||
static uint8_t doors = DOOR_XP /*| DOOR_YP*/ ;
|
static uint8_t doors = DOOR_XP /*| DOOR_YP*/ ;
|
||||||
static uint8_t door_height[4];
|
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};
|
size = {(x+1)*2,(y+1)*2,3};
|
||||||
tmin = {3-x,3-y,0};
|
tmin = {3-x,3-y,0};
|
||||||
tmax = {4+x,4+y,3};
|
tmax = {4+x,4+y,3};
|
||||||
@@ -49,6 +51,8 @@ namespace room
|
|||||||
|
|
||||||
void draw()
|
void draw()
|
||||||
{
|
{
|
||||||
|
draw::swapcol(1, color);
|
||||||
|
|
||||||
// RUTINES DE PINTAT DE LA PORTA DE DALT A LA DRETA
|
// RUTINES DE PINTAT DE LA PORTA DE DALT A LA DRETA
|
||||||
if (doors & DOOR_YN)
|
if (doors & DOOR_YN)
|
||||||
{
|
{
|
||||||
@@ -112,6 +116,8 @@ namespace room
|
|||||||
|
|
||||||
void draw2()
|
void draw2()
|
||||||
{
|
{
|
||||||
|
draw::swapcol(1, color);
|
||||||
|
|
||||||
if (doors & DOOR_YP)
|
if (doors & DOOR_YP)
|
||||||
{
|
{
|
||||||
// Pintem les voreres dels dos tiles extra per a la porta YP
|
// Pintem les voreres dels dos tiles extra per a la porta YP
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
namespace room
|
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 draw();
|
||||||
void draw2();
|
void draw2();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user