Compare commits

..

No commits in common. "7b742c35c4265d08d6092fda62918517a1187bce" and "0352a9e14f599b2d2d64c10ee421b27534a88c98" have entirely different histories.

1 changed files with 3 additions and 16 deletions

View File

@ -154,7 +154,6 @@ function spawnEnemy(x, y)
x = x,
y = y,
until_shoot = enemy_min_shoot + math.random() * (enemy_max_shoot - enemy_min_shoot),
angle = math.random() * 2 * math.pi,
alive = true
})
end
@ -316,9 +315,6 @@ function updateEnemies(dt)
end
end
local dangle = 10 / (2 + enemy.until_shoot) * dt
enemy.angle = enemy.angle + dangle
if not enemy.alive then
table.remove(enemies, i)
else
@ -453,18 +449,9 @@ end
function drawEnemies()
for _, enemy in ipairs(enemies) do
love.graphics.setColor(0.7, 0.5, 1)
local fifth = 2 * math.pi / 5
local points = {}
for i = 0, 4 do
local x = enemy.x + math.cos(i * fifth + enemy.angle) * enemy_radius
local y = enemy.y + math.sin(i * fifth + enemy.angle) * enemy_radius
local x, y = toScreenCoordinates(x, y)
table.insert(points, x)
table.insert(points, y)
end
love.graphics.polygon('fill', points)
local x, y = toScreenCoordinates(enemy.x, enemy.y)
local radius = toScreenSize(enemy_radius)
love.graphics.circle('fill', x, y, radius)
end
end