Commit 602f27ae6534f29b505f8e802b176f91c4a0d65a

Authored by dg
1 parent 202b374c

Fix realtime mode


git-svn-id: http://svn.net-core.org/repos/t-engine4@5137 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -210,7 +210,7 @@ function _M:moveDir(dir)
210 210
211 211 local x, y = self.x + dx, self.y + dy
212 212 self.move_dir = dir
213   -
  213 +
214 214 return self:move(x, y)
215 215 end
216 216
... ...
... ... @@ -386,6 +386,7 @@ function _M:getEntityFinalSurface(tiles, w, h)
386 386
387 387 local mos = {}
388 388 local list = {}
  389 + print("===final surface for", self.uid, self.namself, self.x, self.y, self.type, self.subtype)
389 390 self:getMapObjects(tiles, mos, 1)
390 391 for i = 1, Map.zdepth do
391 392 if mos[i] then list[#list+1] = mos[i] end
... ...
... ... @@ -132,7 +132,7 @@ function _M:tickLevel(level)
132 132 end
133 133 -- print(">ENERGY", e.name, e.uid, "::", e.energy.value, self.paused, "::", e.player)
134 134
135   - if self.paused then
  135 + if self.can_pause and self.paused then
136 136 level.last_iteration = {i=i, e=e}
137 137 -- print("====LEVEL", level.level, level.sublevel_id, "pausing tick loop at ", i, e.name)
138 138 break
... ...
... ... @@ -27,6 +27,8 @@ require "engine.GameEnergyBased"
27 27 -- @inherit engine.GameEnergyBased
28 28 module(..., package.seeall, class.inherit(engine.GameEnergyBased))
29 29
  30 +can_pause = true
  31 +
30 32 --- See engine.GameEnergyBased
31 33 function _M:init(keyhandler, energy_to_act, energy_per_tick)
32 34 self.paused = false
... ...