diff --git a/data/caixes.gif b/data/caixes.gif index d868d8b..b0919ca 100644 Binary files a/data/caixes.gif and b/data/caixes.gif differ diff --git a/data/floor.gif b/data/floor.gif index 8d180d8..b5c635d 100644 Binary files a/data/floor.gif and b/data/floor.gif differ diff --git a/data/rooms/00.txt b/data/rooms/00.txt index 52af3c0..b6554fb 100644 --- a/data/rooms/00.txt +++ b/data/rooms/00.txt @@ -7,18 +7,10 @@ floor-texture: 0 wall-texture: 2 door-texture: 0 under-door-texture: 0 +exit-xp: 5 exit-xn: 1 exit-zn: 2 -actor{ - name: PLATFORM00 - bmp: test.gif - bmp-rect: 64 0 32 24 - bmp-offset: 0 24 - pos: 8 28 0 - size: 8 8 4 -} - actor{ name: PLATFORM02 bmp: test.gif @@ -28,6 +20,15 @@ actor{ size: 8 8 4 } +actor{ + name: PLATFORM00 + bmp: test.gif + bmp-rect: 64 0 32 24 + bmp-offset: 0 24 + pos: 8 28 0 + size: 8 8 4 +} + actor{ name: PLATFORM01 bmp: test.gif diff --git a/data/rooms/02.txt b/data/rooms/02.txt index 373015f..d5d73f1 100644 --- a/data/rooms/02.txt +++ b/data/rooms/02.txt @@ -8,6 +8,7 @@ wall-texture: 2 door-texture: 0 under-door-texture: 2 exit-xn: 3 +exit-yp: 4 exit-zp: 0 actor{ diff --git a/data/rooms/04.txt b/data/rooms/04.txt new file mode 100644 index 0000000..6989325 --- /dev/null +++ b/data/rooms/04.txt @@ -0,0 +1,250 @@ +width: 2 +height: 3 +door-height-yp: 2 +door-height-yn: 2 +color: GREEN +floor-texture: 1 +wall-texture: 5 +door-texture: 4 +under-door-texture: 0 +exit-yn: 2 + +actor{ + name: BOX + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 8 0 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX02 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 16 0 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX03 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 24 0 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX20 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 8 8 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX01 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 8 16 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX11 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 8 24 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX12 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 8 32 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX13 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 8 40 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX14 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 8 48 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX21 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 8 56 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX15 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 16 56 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX16 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 24 56 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX04 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 32 0 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX17 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 32 56 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX05 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 40 0 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX22 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 48 0 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX06 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 48 8 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX07 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 48 16 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX08 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 48 24 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX09 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 48 32 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX10 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 48 40 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX19 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 48 48 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX18 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 40 56 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX23 + bmp: caixes.gif + bmp-rect: 64 64 32 32 + bmp-offset: 0 32 + pos: 48 56 0 + size: 8 8 8 + movement: CW +} diff --git a/data/rooms/05.txt b/data/rooms/05.txt new file mode 100644 index 0000000..c765d43 --- /dev/null +++ b/data/rooms/05.txt @@ -0,0 +1,9 @@ +width: 2 +height: 2 +door-height-xn: 0 +color: YELLOW +floor-texture: 8 +wall-texture: 8 +door-texture: 5 +under-door-texture: 0 +exit-xn: 0 diff --git a/data/walls.gif b/data/walls.gif index efb5c26..2189dae 100644 Binary files a/data/walls.gif and b/data/walls.gif differ diff --git a/source/main.cpp b/source/main.cpp index 44c89ea..633b882 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -26,6 +26,8 @@ int room_walldoors = 0; std::vector gifs; +int treeview_scroll = 0; + void restart() { room::load(0); //room_w, room_h, room_xp, room_xn, room_yp, room_yn, room_color, room_floor, room_walls, room_doors, room_walldoors); @@ -424,13 +426,25 @@ bool game::loop() draw::color(PAPER); draw::rect(2, 15, 96, 223); - draw::setViewport(0, 15, 100, 225); + draw::setViewport(0, 15, 100, 222); const int mx = draw::getLocalX(input::mouseX()); const int my = draw::getLocalY(input::mouseY()); const bool btnDown = input::mouseBtn(1) || input::mouseBtn(3); + + if (mx>=0 && mx <=100 && my>=0 && my<=221) + { + treeview_scroll -= input::mouseWheel(); + if (treeview_scroll<0) treeview_scroll=0; + } - int line = 0; + switch (section) + { + case SECTION_GENERAL: treeview_scroll = 0; break; + case SECTION_ROOM: if (treeview_scroll > room::editor::getCurrentRoom()+1) treeview_scroll = room::editor::getCurrentRoom()+1; + } + + int line = -treeview_scroll; if (section==SECTION_GENERAL) { draw::color(LIGHT+BLUE); @@ -483,6 +497,14 @@ bool game::loop() } } + if ((line+treeview_scroll)>24) + { + const float total_size = float(line+treeview_scroll); + int ascensor_length = 222.0f/(total_size/24.0f); + int ascensor_pos = 222.0f/(total_size/treeview_scroll); + draw::color(WHITE); + draw::fillrect(95, ascensor_pos, 2, ascensor_length); + } /* break; case 1: diff --git a/todo.txt b/todo.txt index c479fa7..8c42367 100644 --- a/todo.txt +++ b/todo.txt @@ -10,6 +10,10 @@ x Gràfics de taula - Grafics de cadires - Gràfics de conveyor belt x Gràfics de consoles i comps +- Gràfics de nevera +- Gràfics de bancada de cuina +- Gràfics de sofà? +- Gràfics de Plantes, arbres... - Decidir objectes de habilitats - Motxilla, espardenyes... @@ -18,7 +22,7 @@ x Gràfics de consoles i comps - Implementar eixides per dalt x Implementar eixides per baix -- Implementar pickar objectes +x Implementar pickar objectes - Implementar inventari - Menus