love:mike moved function into it's own library; moved libs to lib folder
This commit is contained in:
parent
7e844925e8
commit
f028d9d4fe
14
love/mike/lib/functions.lua
Normal file
14
love/mike/lib/functions.lua
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
function col_detect(object, display)
|
||||||
|
if not (object.x >= -1 and
|
||||||
|
object.x <= (display.width - object.width)) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
if not (object.y >= -1 and
|
||||||
|
object.y <= (display.height - object.height)) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
require "Tserial"
|
require "lib/Tserial"
|
||||||
|
|
||||||
function love.keyreleased(key)
|
function love.keyreleased(key)
|
||||||
if key == "q" then
|
if key == "q" then
|
@ -1,19 +1,5 @@
|
|||||||
require "keys"
|
require "lib/keys"
|
||||||
|
require "lib/functions"
|
||||||
-- Make this more functional. It shouldn't depend on global state.
|
|
||||||
function col_detect(object, display)
|
|
||||||
if not (object.x >= -1 and
|
|
||||||
object.x <= (display.width - object.width)) then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
if not (object.y >= -1 and
|
|
||||||
object.y <= (display.height - object.height)) then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
function love.load()
|
function love.load()
|
||||||
saveFile = "test.lua"
|
saveFile = "test.lua"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user