Search found 3 matches

by B0073D
Tue Mar 20, 2012 5:43 am
Forum: General
Topic: What am I doing wrong??
Replies: 4
Views: 3277

Re: What am I doing wrong??

Yeah placing that line inside a not fixes it.

Code: Select all

if creepsinrange[1] ~= nil then
	table.remove(squares, fclosest(creepsinrange))
end
Again, sorry about the horrible code. Half asleep too...

There's still a few things wrong with my code but at least I can move on now.
by B0073D
Tue Mar 20, 2012 5:36 am
Forum: General
Topic: What am I doing wrong??
Replies: 4
Views: 3277

Re: What am I doing wrong??

Yeah sorry about the code, I should have cleaned it up a bit. I can't move it there otherwise it'd kill everything in range rather than one thing in range. That line needs to be outside of the for loop starting at 96. The fclosest function goes through everything that's been placed into creepsinrang...
by B0073D
Tue Mar 20, 2012 5:06 am
Forum: General
Topic: What am I doing wrong??
Replies: 4
Views: 3277

What am I doing wrong??

Hi Guys, I've been coding in Lua for a couple of days now with Löve. I've written a little tower defence test case but my code to find targets in range doesn't seem to work. It seems to think everything is in range... I cant figure out what I've done wrong here.... And then it seems to randomly kill...