Zombie Spawning problems

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Sinono3
Prole
Posts: 7
Joined: Mon Aug 18, 2014 5:52 pm

Zombie Spawning problems

Post by Sinono3 »

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:

Code: Select all

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
Please if you can transform the code, please :cry: (I'm a newbie to code)
Sorry, I tried to attach my love file but it dont works, so I will give you a link.
https://mega.co.nz/#!30oQ1R4I!mY3iQ_Hl7 ... S4CQyFDMQE
User avatar
MadByte
Party member
Posts: 533
Joined: Fri May 03, 2013 6:42 pm
Location: Braunschweig, Germany

Re: Zombie Spawning problems

Post by MadByte »

Hi & welcome on the forums!

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?
User avatar
Sinono3
Prole
Posts: 7
Joined: Mon Aug 18, 2014 5:52 pm

Re: Zombie Spawning problems

Post by Sinono3 »

MadByte wrote:Hi & welcome on the forums!

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?
User avatar
MadByte
Party member
Posts: 533
Joined: Fri May 03, 2013 6:42 pm
Location: Braunschweig, Germany

Re: Zombie Spawning problems

Post by MadByte »

Here is a thread where I explain one way to do it:
Click me!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 3 guests