Almost done drawing lines
This commit is contained in:
parent
74fdcd51f7
commit
abce928481
4 changed files with 159 additions and 7 deletions
25
config.lua
25
config.lua
|
|
@ -9,7 +9,10 @@ Config = {
|
|||
|
||||
-- love2d line drawing settings
|
||||
lineStyle = "smooth",
|
||||
lineWidth = 5
|
||||
lineWidth = 5,
|
||||
|
||||
-- drag sensivity, px
|
||||
dragSensivity = 5
|
||||
}
|
||||
|
||||
-- Colors table
|
||||
|
|
@ -19,3 +22,23 @@ Color = {
|
|||
green = { 0, 1, 0 },
|
||||
blue = { 0, 0, 1 }
|
||||
}
|
||||
|
||||
-- Find key by value in table by predicate
|
||||
function tableFind( table, value, pred )
|
||||
for key, innervalue in pairs( table ) do
|
||||
if pred( value, innervalue ) then
|
||||
return key
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Find if value exists in table by predicate
|
||||
function tableHas( table, value, pred )
|
||||
for key, innervalue in pairs( table ) do
|
||||
if pred( value, innervalue ) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue