Search found 15 matches

by HedgeHog builder
Tue Oct 24, 2017 2:29 am
Forum: Support and Development
Topic: Lighters pause in midpoints
Replies: 10
Views: 2610

Re: Lighters pause in midpoints

Will this work?

distances = {}

for key,value in ipairs(beacons) do
for i,unit in ipairs(spawned units)
local distance = math.sqrt((unit.x-k.x)^2 + (unit.y-k.y)^2
table.insert(distances,distance)
end
table.sort(distances)

Then pick the last one?
by HedgeHog builder
Mon Oct 23, 2017 7:51 pm
Forum: Support and Development
Topic: Lighters pause in midpoints
Replies: 10
Views: 2610

Re: Lighters pause in midpoints

How would I select the closest one?

if distance < k.x,k.y?
by HedgeHog builder
Sun Oct 22, 2017 3:07 am
Forum: Support and Development
Topic: Lighters pause in midpoints
Replies: 10
Views: 2610

Re: Lighters pause in midpoints

So if I wanted to do comparison on distance between 2 points from the unit would I do

Code: Select all

unitdist 1 = unit.x - k.x
unit 2 = unit.x - k.x

if unitdist1 < unit2 then
target = unitdist1
else 
target = unit2
by HedgeHog builder
Fri Oct 20, 2017 7:33 am
Forum: Support and Development
Topic: Lighters pause in midpoints
Replies: 10
Views: 2610

Re: Lighters pause in midpoints

for i,v in ipairs(Opposing_Pens) do for k,Beacon in ipairs(Beacons) do if (v.target == nil) then v.target = k elseif (v.target ~= k) then break end So line by line: For each index and value of opposing pens do; for each index and value of beacons do; if the target of opposing pens is non existent; ...
by HedgeHog builder
Thu Oct 19, 2017 7:01 am
Forum: Support and Development
Topic: Lighters pause in midpoints
Replies: 10
Views: 2610

Re: Lighters pause in midpoints

It actually still does the pause in midpoints. I would like it to go from first beacon placed to second, then third.

Does anyone know how to do that?
by HedgeHog builder
Sun Oct 15, 2017 5:49 am
Forum: Support and Development
Topic: Lighters pause in midpoints
Replies: 10
Views: 2610

Lighters pause in midpoints

So when you left click; a beacon spawns, they are square and very small When you right click; a spawner appears, spawners are circles The lighters, which are the products of the spawners, will then go to the beacons. However, if you place the beacons in a line like this; The lighters will end up pau...
by HedgeHog builder
Tue Oct 10, 2017 8:11 am
Forum: Support and Development
Topic: Why does one of my timers take longer to go down to 0?
Replies: 1
Views: 636

Why does one of my timers take longer to go down to 0?

It could just be my computer, but to me Follow_Timer seems to count down a lot slower than timer: love.graphics.print(Follow_Timer,0,0) love.graphics.print(DirX,0,25) love.graphics.print(DirY,0,50) love.graphics.print(timer,150,0) Both timers are going down by 1*dt, which I think should be the same ...
by HedgeHog builder
Mon Oct 09, 2017 10:03 am
Forum: Support and Development
Topic: Deleting enemies if too much
Replies: 1
Views: 662

Deleting enemies if too much

I wish to stop enemies spawning when there are over 5 enemies, keeping the number of enemies at 5 I however have no idea how to do this properly, and as a result the enemies keep spawning and do not stop Might be good to look at: if timer < 1 and MaxPens < 5 then Enemy_Pen_Spawn(randomX,randomY,20,2...
by HedgeHog builder
Mon Oct 02, 2017 8:26 am
Forum: Support and Development
Topic: Follower units have a following glitch
Replies: 1
Views: 598

Follower units have a following glitch

What is supposed to happen: The follower is supposed to be following the mouse-controlled player but suffers from glitches. Glitch 1 The follower does not move vertically. That is, it does not move up and down regardless of where the player is. Glitch 2 The follower only follows you to the right if ...