Skip to content

Instantly share code, notes, and snippets.

piXelicidio

Block or report user

Report or block piXelicidio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@piXelicidio
piXelicidio / api.lua
Created Mar 27, 2017
Corona SDK or Love2D detect
View api.lua
-- Dirty trick to detect if Corona SDK or Love ;)
-- first time we require this module it will be inialized with the current detected SDK
if display~=nil then
-- maybe is corona sdk
if display.newImage~=nil then
-- pretty sure it is
print "Running: Corona SDK"
api = require('code.coronaapi')
end
elseif love~=nil then
@piXelicidio
piXelicidio / docfunction.lua
Last active Mar 25, 2017
LDoc tags example
View docfunction.lua
---Module docfunction
-- Example of using LDoc
--@author Denys Almaral
--- This function calculate the distance the closest enemy.
--@param pPos The vector(x,y) position of the player
--@param enemies The list of all enemies in the current level
--@return Float distance to closest enemy.
--@usage dist = DistanceToDanger(player.pos, level.enemies)
function DistanceToDanger(pPos, enemies)
You can’t perform that action at this time.