Commit bd8c270fc2c4882edcb6983bb7b56ba07ec96eae
1 parent
79bd5915
fix
git-svn-id: http://svn.net-core.org/repos/t-engine4@3326 51575b47-30f0-44d4-a5cc-537603b46e54
Showing
4 changed files
with
19 additions
and
14 deletions
... | ... | @@ -27,6 +27,7 @@ function _M:init(w, h, min_w, min_h, max_depth) |
27 | 27 | self.max_depth = max_depth or 8 |
28 | 28 | self.min_w, self.min_h = min_w, min_h |
29 | 29 | self.node_id = 1 |
30 | + self.splits = { vert={}, hor={} } | |
30 | 31 | self.leafs = {} |
31 | 32 | self.bsp = {x=0, y=0, rx=0, ry=0, w=w, h=h, nodes={}, id=0, depth=0} |
32 | 33 | print("[BSP] ", w, h) |
... | ... | @@ -52,6 +53,7 @@ function _M:partition(store) |
52 | 53 | -- print("[BSP] vertical split", s) |
53 | 54 | store.nodes[1] = {depth=store.depth+1, x=0, y=0, rx=store.rx, ry=store.ry, w=store.w, h=s, nodes={}, id=self.node_id} self.node_id = self.node_id + 1 |
54 | 55 | store.nodes[2] = {depth=store.depth+1, x=0, y=s, rx=store.rx, ry=store.ry + s, w=store.w, h=store.h - s, nodes={}, id=self.node_id} self.node_id = self.node_id + 1 |
56 | + self.splits.vert[store.ry + s] = true | |
55 | 57 | self:partition(store.nodes[1]) |
56 | 58 | self:partition(store.nodes[2]) |
57 | 59 | |
... | ... | @@ -60,6 +62,7 @@ function _M:partition(store) |
60 | 62 | -- print("[BSP] horizontal split", s) |
61 | 63 | store.nodes[1] = {depth=store.depth+1, x=0, y=0, rx=store.rx, ry=store.ry, w=s, h=store.h, nodes={}, id=self.node_id} self.node_id = self.node_id + 1 |
62 | 64 | store.nodes[2] = {depth=store.depth+1, x=s, y=0, rx=store.rx + s, ry=store.ry, w=store.w -s , h=store.h, nodes={}, id=self.node_id} self.node_id = self.node_id + 1 |
65 | + self.splits.hor[store.rx + s] = true | |
63 | 66 | self:partition(store.nodes[1]) |
64 | 67 | self:partition(store.nodes[2]) |
65 | 68 | end | ... | ... |
... | ... | @@ -937,7 +937,7 @@ function _M:setupCommands() |
937 | 937 | -- self.state:debugRandomZone() |
938 | 938 | -- local m = game.zone:makeEntity(game.level, "actor", {random_boss=true}, nil, true) |
939 | 939 | -- if m then game.zone:addEntity(game.level, m, "actor", game.player.x, game.player.y + 1) end |
940 | - self:registerDialog(require("mod.dialogs.Donation").new()) | |
940 | + self:changeLevel(1, "test") | |
941 | 941 | end end, |
942 | 942 | } |
943 | 943 | ... | ... |
... | ... | @@ -28,17 +28,17 @@ return { |
28 | 28 | all_remembered = true, |
29 | 29 | all_lited = true, |
30 | 30 | -- persistent = "zone", |
31 | + no_level_connectivity = true, | |
31 | 32 | generator = { |
32 | 33 | map = { |
33 | - class = "engine.generator.map.Octopus", | |
34 | - main_radius = {0.3, 0.4}, | |
35 | - arms_radius = {0.1, 0.2}, | |
36 | - arms_range = {0.7, 0.8}, | |
37 | - nb_rooms = {5, 9}, | |
38 | - ['.'] = "FLOOR", | |
39 | - ['#'] = "WALL", | |
40 | - up = "FLOOR", | |
41 | - down = "FLOOR", | |
34 | + class = "engine.generator.map.Building", | |
35 | + max_building_w = 5, max_building_h = 5, | |
36 | + floor = "FLOOR", | |
37 | + external_floor = "FLOOR", | |
38 | + wall = "WALL", | |
39 | + up = "FLAT_UP6", | |
40 | + down = "FLAT_DOWN4", | |
41 | + door = "DOOR", | |
42 | 42 | }, |
43 | 43 | actor = { |
44 | 44 | class = "engine.generator.actor.Random", | ... | ... |
... | ... | @@ -49,11 +49,13 @@ function _M:init(l, w, force_height) |
49 | 49 | end |
50 | 50 | |
51 | 51 | local h = math.min(force_height and (force_height * game.h) or 999999999, self.font_h * #list) |
52 | + local c_text = require("engine.ui.Textzone").new{ | |
53 | + width=w+10, height=h, scrollbar=(h < self.font_h * #list) and true or false, text=text, color={r=0x3a, g=0x35, b=0x33}, | |
54 | + } | |
55 | + c_text:setTextShadow(false) | |
56 | + | |
52 | 57 | self:loadUI{ |
53 | - {left = 3, top = 3, ui=require("engine.ui.Textzone").new{ | |
54 | - width=w+10, height=h, scrollbar=(h < self.font_h * #list) and true or false, text=text, color={r=0x3a, g=0x35, b=0x33}, | |
55 | - } | |
56 | - } | |
58 | + {left = 3, top = 3, ui=c_text} | |
57 | 59 | } |
58 | 60 | self.key:addBind("EXIT", function() game:unregisterDialog(self) if fct then fct() end end) |
59 | 61 | self.key:addBind("ACCEPT", function() game:unregisterDialog(self) if fct then fct() end end) | ... | ... |
-
Please register or login to post a comment