I'm making a zombie game, but... I had to many problems with the AI Spawning. I already searched on all the forums (I think).
And nothing worked, I giving my code of the zombie AI:
require("player")
zombie = {}
function zombie.load()
zombie.img = love.graphics.newImage("images/zombie.png")
zombie.x = 400
zombie.y = 300
zombie.speed = 1
end
function zombie.update()
zombie.angle = math.atan2(player.x - zombie.x, zombie.y - player.y)
if player.x < zombie.x then
zombie.x = zombie.x - zombie.speed
end
if player.x > zombie.x then
zombie.x = zombie.x + zombie.speed
end
if player.y < zombie.y then
zombie.y = zombie.y - zombie.speed
end
if player.x > zombie.x then
zombie.y = zombie.y + zombie.speed
end
end
First off, it would be great if you could remove your second thread. One should be enough :p
Then for your problem, I don't really get your question. What do you need to be done exactly?
First off, it would be great if you could remove your second thread. One should be enough :p
Then for your problem, I don't really get your question. What do you need to be done exactly?
Well, 2 things.
1st: I want to delete this thread for just keeping the other one, I dont know how so...
2nd: My question is: How do I do to make multiple zombies spawn?