Deaggressify slimes even more

This commit is contained in:
Juhani Krekelä 2019-06-29 23:51:52 +03:00
parent 15e449736b
commit 2be9ed6202
1 changed files with 7 additions and 3 deletions

View File

@ -608,8 +608,8 @@ function moveSlimes()
local to_player_dx = player_x - slime.x
local to_player_dy = player_y - slime.y
if math.abs(to_player_dx) + math.abs(to_player_dy) <= 7 and math.random() < 0.7 then
-- If at max 7 moves away from player, book for it (likely)
if math.abs(to_player_dx) + math.abs(to_player_dy) <= 5 and math.random() < 0.7 then
-- If at max 5 moves away from player, book for it (likely)
if math.abs(to_player_dx) > math.abs(to_player_dy) then
-- Needs to move more in the horizontal direction → move horizontally
if to_player_dx < 0 then
@ -723,9 +723,13 @@ function drawCavern()
love.graphics.setColor(0, 0, 1)
love.graphics.ellipse('fill', x + 0.5 * x_scale, y + 0.5 * y_scale, 0.8 * x_scale/2, 0.8 * y_scale/2)
love.graphics.rectangle('fill', x + 0.1 * x_scale , y + 0.5 * y_scale, 0.8 * x_scale, 0.8 * y_scale/2)
else
elseif tile == tiletypes.unknown then
love.graphics.setColor(1, 0.5, 0.5)
love.graphics.rectangle('fill', x, y, x_scale, y_scale)
else
print("Impossible tile!!!")
love.graphics.setColor(1, 0, 0)
love.graphics.rectangle('fill', x, y, x_scale, y_scale)
end
else
tile = remembered_cavern[tile_x][tile_y]