Thought I might have an application so diddled with the code.
Your comment:
Code: Select all
DISCLAIMER: Don't scroll down if you can't stand ugly code.
Don't mind ugly code (produce a lot of it myself) but semicolons - UG!
Moved all of the constants up front for easy adjustments (rather than having them distributed in the modules).
Code: Select all
-- ------------------------------------------------
-- Constants
-- ------------------------------------------------
local color = {
background = { 204, 224, 232 },
node = { 130, 190, 238 },
edge = { 100, 100, 100 },
text = { 30, 100, 256 },
cursor = { 234, 49, 110 }
}
local sprite = { image = love.graphics.newImage( 'file.png' ), size = 16 }
sprite.ht = sprite.image:getHeight()
sprite.scale= sprite.size/sprite.ht
sprite.offset= sprite.ht/2
force = { spring = 0.005, change = 20, max = 4 }
param = { speed = 128, damping = 0.95, mass = 3 }
local data = { sets = { 'GraphoonData', 'program', 'EvilDead' }, selected = 1 }
local screen = { wd = 1200, ht = 700 }
and added ability to switch data sets on the fly ('N' key).
Conclusion: Very interesting but really don't know what to do with it.