diff --git a/game/engines/default/engine/FlyingText.lua b/game/engines/default/engine/FlyingText.lua index 853e0fb024812d2c9f2310a2dba33bee0f2b3524..2b3f28ec6ea521c02772f8fa688c71fbd6678252 100644 --- a/game/engines/default/engine/FlyingText.lua +++ b/game/engines/default/engine/FlyingText.lua @@ -35,13 +35,17 @@ function _M:add(x, y, duration, xvel, yvel, str, color, bigfont) color = color or {255,255,255} local s = core.display.drawStringBlendedNewSurface(bigfont and self.bigfont or self.font, str, color[1], color[2], color[3]) if not s then return end + local w, h = s:getSize() + local t, tw, th = s:glTexture() local f = { x=x, y=y, + w=w, h=h, + tw=tw, th=th, duration=duration or 10, xvel = xvel or 0, yvel = yvel or 0, - s = s + t = t, } self.flyers[f] = true return f @@ -57,7 +61,7 @@ function _M:display() local dels = {} for fl, _ in pairs(self.flyers) do - fl.s:toScreen(fl.x, fl.y) + fl.t:toScreenFull(fl.x, fl.y, fl.w, fl.h, fl.tw, fl.th) fl.x = fl.x + fl.xvel fl.y = fl.y + fl.yvel fl.duration = fl.duration - 1 diff --git a/game/modules/tome/ai/escort.lua b/game/modules/tome/ai/escort.lua index 16b77b86a429f2f5ddb50732e9fba549c93a666e..f6c24113f2b31fb302ea748ecfad38b2be78f0f9 100644 --- a/game/modules/tome/ai/escort.lua +++ b/game/modules/tome/ai/escort.lua @@ -45,10 +45,15 @@ newAI("move_escort", function(self) local tx, ty = self.escort_target.x, self.escort_target.y local a = Astar.new(game.level.map, self) - local path = a:calc(self.x, self.y, tx, ty) + local path = self.escort_path + if not path or #path == 0 then path = a:calc(self.x, self.y, tx, ty) end if not path then return self:runAI("move_simple") else + self.escort_path = {} + for i = 1, 3 do + if path[i+1] then self.escort_path[i] = path[i+1] end + end return self:move(path[1].x, path[1].y) end end diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 5bb2678148b6f431517f8fc587ebea19fd7234c9..760e5fb6cf40d8f11a4f1b9f3a2703a727445364 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -435,13 +435,14 @@ function _M:display() if not self.zone_name_s then local s = core.display.drawStringBlendedNewSurface(self.player_display.font, ("%s (%d)"):format(self.zone.name, self.level.level), 0, 255, 255) - self.zone_name_s = s:glTexture() self.zone_name_w, self.zone_name_h = s:getSize() + self.zone_name_s, self.zone_name_tw, self.zone_name_th = s:glTexture() end - self.zone_name_s:toScreen( + self.zone_name_s:toScreenFull( self.level.map.display_x + self.level.map.viewport.width - self.zone_name_w, self.level.map.display_y + self.level.map.viewport.height - self.zone_name_h, - self.zone_name_w, self.zone_name_h + self.zone_name_w, self.zone_name_h, + self.zone_name_tw, self.zone_name_th ) -- Minimap display