Search found 76 matches

by BruceTheGoose
Sat Sep 27, 2014 3:49 pm
Forum: General
Topic: Finding the closest position
Replies: 8
Views: 7559

Re: Finding the closest position

Here
by BruceTheGoose
Sat Sep 27, 2014 2:14 am
Forum: General
Topic: Finding the closest position
Replies: 8
Views: 7559

Re: Finding the closest position

So I re-wrote my bullets and I'm getting a stupid error. I suspect the reason for the error is that I haven't created a new bullet and I'm calling its update function. Here is the code. Bullet = {} function Bullet:New(x,y,x1,y1,rot,type,damage,speed) local startX = x local startY = y local angle = m...
by BruceTheGoose
Sat Sep 27, 2014 1:05 am
Forum: General
Topic: Finding the closest position
Replies: 8
Views: 7559

Re: Finding the closest position

If you use lots of functions like this one, your code tends to become unmanageable, especially if you return to it after not touching it for several months. It’s a code that you understand while you are writing, and certainly the machine understands it, but it doesn’t have “signposts” for future vi...
by BruceTheGoose
Sat Sep 27, 2014 12:47 am
Forum: General
Topic: Finding the closest position
Replies: 8
Views: 7559

Re: Finding the closest position

Coincidence? Thank you so much I'll look into it :)
by BruceTheGoose
Sat Sep 27, 2014 12:21 am
Forum: General
Topic: Finding the closest position
Replies: 8
Views: 7559

Finding the closest position

allies = {} enemies = {} for _,v in ipairs(allies) do if v.target == 0 then for i = 1, #enemies do v.currentBest = getMagnitude(v.x,enemies[i].x + enemy:getWidth()/2,v.y,enemies[i].y + enemy:getHeight()/2) if getMagnitude(v.x,enemies[i].x + enemy:getWidth()/2,v.y,enemies[i].y + enemy:getHeight()/2)...
by BruceTheGoose
Sat Sep 20, 2014 3:00 pm
Forum: General
Topic: Help with Canvases and Shaders
Replies: 1
Views: 1720

Help with Canvases and Shaders

Intro = {} Intro.Alpha = 0 Intro.Appeared = true function Intro:Load() Logo = love.graphics.newImage("Resources/Gfx/LoveLogo.png") iCanvas = love.graphics.newCanvas() local str = love.filesystem.read("Resources/Shaders/CRT-Simple.frag") scanline = love.graphics.newShader(str) sc...