Re: Enemy/AI system
Posted: Wed Dec 21, 2011 10:40 pm
Incorrect parameter type: expected userdataRobin wrote:That's more like it.
You made a mistake with the variable name. You used zomb, while it should be zombie.
Incorrect parameter type: expected userdataRobin wrote:That's more like it.
You made a mistake with the variable name. You used zomb, while it should be zombie.
I'm sorry, I'm just lost. What are the x and y properties supposed to be? zombie.x and zombie.y don't work, dt.x dt.y, self.x self.y, zombietype.x, zombietype.y, etc.Robin wrote:That's because you set x and y to 0. Set them to something different (for example using math.random, like you wanted) to put the zombies in other positions.
To make them move, change the x and y properties of the zombies in love.update.
It looks like you guess/expect too much without knowing much of how things work. We beginners are lucky that the wiki provides awesome tutorials that guide us through the first steps into the compelling and fun matter of programming with LÖVE:MP6767 wrote:I'm sorry, I'm just lost. What are the x and y properties supposed to be? zombie.x and zombie.y don't work, dt.x dt.y, self.x self.y, zombietype.x, zombietype.y, etc.Robin wrote:That's because you set x and y to 0. Set them to something different (for example using math.random, like you wanted) to put the zombies in other positions.
To make them move, change the x and y properties of the zombies in love.update.
clickrush wrote:I'am sorry I just now found your code in one of your replies. Your questions just seemed to be so general that I assumed your a complete beginner like me. Looking at the code I don't really get what your doing actually
MP6767 wrote: I'm sorry, I'm just lost. What are the x and y properties supposed to be? zombie.x and zombie.y don't work, dt.x dt.y, self.x self.y, zombietype.x, zombietype.y, etc.
Code: Select all
for i, foo in pairs(zombies) do
foo.x = ....
...
end