- Seguim en les portes
This commit is contained in:
@@ -16,7 +16,7 @@ void game::init()
|
|||||||
draw::loadPalette("test.gif");
|
draw::loadPalette("test.gif");
|
||||||
game::setUpdateTicks(64);
|
game::setUpdateTicks(64);
|
||||||
|
|
||||||
room::load(2,2);
|
room::load(2,0);
|
||||||
|
|
||||||
box = actor::create({16,16,0}, {8,8,4}, {64,0,32,24}, {0,24});
|
box = actor::create({16,16,0}, {8,8,4}, {64,0,32,24}, {0,24});
|
||||||
box->flags = FLAG_MOVING;
|
box->flags = FLAG_MOVING;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace room
|
|||||||
static vec3_t min = {0,0,0};
|
static vec3_t min = {0,0,0};
|
||||||
static vec3_t max = {56,56,56};
|
static vec3_t max = {56,56,56};
|
||||||
|
|
||||||
static uint8_t doors = DOOR_XN ;
|
static uint8_t doors = DOOR_XN | DOOR_YN ;
|
||||||
static uint8_t door_height[4];
|
static uint8_t door_height[4];
|
||||||
|
|
||||||
void load(int x, int y)
|
void load(int x, int y)
|
||||||
@@ -22,7 +22,7 @@ namespace room
|
|||||||
door_height[0] = 2; //XP
|
door_height[0] = 2; //XP
|
||||||
door_height[1] = 3; //XN
|
door_height[1] = 3; //XN
|
||||||
door_height[2] = 2; //YP
|
door_height[2] = 2; //YP
|
||||||
door_height[3] = 2; //YN
|
door_height[3] = 5; //YN
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw()
|
void draw()
|
||||||
@@ -30,8 +30,8 @@ namespace room
|
|||||||
if (doors & DOOR_YN)
|
if (doors & DOOR_YN)
|
||||||
{
|
{
|
||||||
if (door_height[3] > 0) {
|
if (door_height[3] > 0) {
|
||||||
draw::draw( 164+3*16-tmin.y*16, (36+3*8+tmin.y*8) + (5-door_height[3])*8, 16, 48+(door_height[3]*8), 128, 16+(5-door_height[3])*8);
|
draw::draw( 164+3*16-tmin.y*16, (36+3*8+tmin.y*8) + (5-door_height[3])*8, 16, 48-(5-door_height[3])*8, 128, 16+(5-door_height[3])*8);
|
||||||
draw::draw( 164+4*16-tmin.y*16, (36+4*8+tmin.y*8) + (5-door_height[3])*8, 16, 48+(door_height[3]*8), 128, 16+(5-door_height[3])*8);
|
draw::draw( 164+4*16-tmin.y*16, (36+4*8+tmin.y*8) + (5-door_height[3])*8, 16, 48-(5-door_height[3])*8, 128, 16+(5-door_height[3])*8);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pintem els dos tiles baix de la porta
|
// Pintem els dos tiles baix de la porta
|
||||||
@@ -45,11 +45,12 @@ namespace room
|
|||||||
if (doors & DOOR_XN)
|
if (doors & DOOR_XN)
|
||||||
{
|
{
|
||||||
if (door_height[1] > 0) {
|
if (door_height[1] > 0) {
|
||||||
draw::draw(148+tmin.x*16-3*16, (36+tmin.x*8+3*8)+(5-door_height[1])*8, 16, 48+(door_height[1]*8), 144, 16+(5-door_height[1])*8);
|
draw::draw(148+tmin.x*16-3*16, (36+tmin.x*8+3*8)+(5-door_height[1])*8, 16, 48-(5-door_height[1])*8, 144, 16+(5-door_height[1])*8);
|
||||||
draw::draw(148+tmin.x*16-4*16, (36+tmin.x*8+4*8)+(5-door_height[1])*8, 16, 48+(door_height[1]*8), 144, 16+(5-door_height[1])*8);
|
draw::draw(148+tmin.x*16-4*16, (36+tmin.x*8+4*8)+(5-door_height[1])*8, 16, 48-(5-door_height[1])*8, 144, 16+(5-door_height[1])*8);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pintem els dos tiles baix de la porta
|
// Pintem els dos tiles baix de la porta
|
||||||
|
draw::draw(164+(tmin.x-1)*16-5*16, -door_height[1]*8+84+(tmin.x-1)*8+4*8, 16, 15, 128, 49); // Vora
|
||||||
draw::draw(148+(tmin.x-1)*16-3*16, -door_height[1]*8+76+(tmin.x-1)*8+3*8,32,15,0,1);
|
draw::draw(148+(tmin.x-1)*16-3*16, -door_height[1]*8+76+(tmin.x-1)*8+3*8,32,15,0,1);
|
||||||
draw::draw(148+(tmin.x-1)*16-4*16, -door_height[1]*8+76+(tmin.x-1)*8+4*8,32,15,0,1);
|
draw::draw(148+(tmin.x-1)*16-4*16, -door_height[1]*8+76+(tmin.x-1)*8+4*8,32,15,0,1);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user