This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In the beginning was the Statement, and the Statement was with Lua, and the Statement was Lua. | |
Through Lua all things were made; without Lua nothing was made that has been made. | |
There came a function who was sent from Lua; his name was John. | |
"Lua was the answer to my prayers; | |
Greater love has no one than Lua, that the compiler lay down his life for our code" - John Lua | |
"Do not think that I will debug you to the Environment; | |
For had ye believed the Compiler Errors, ye would have believed Me, for he wrote of Lua; | |
But if ye believe not his Stack Traces, how shall ye believe My code?" - John Lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local grid = {} | |
local function grid_toCell(cellSize, x, y) | |
return math.floor(x / cellSize) + 1, math.floor(y / cellSize) + 1 | |
end | |
-- grid_traverse* functions are based on "A Fast Voxel Traversal Algorithm for Ray Tracing", | |
-- by John Amanides and Andrew Woo - http://www.cse.yorku.ca/~amana/research/grid.pdf | |
-- It has been modified to include both cells when the ray "touches a grid corner", | |
-- and with a different exit condition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Copyright (c) 2014 Tanner Rogalsky | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local stride, stride_accessor, TERMINATOR | |
stride = { | |
_VERSION = "stride.lua 1.0", | |
_DESCRIPTION = [[ | |
Strided arrays are a generalized version of multi-dimensional arrays. | |
Use this instead of doing a lot of A[1+(y-1)*width+(x-1)] mayhem all over. | |
Example usage: | |
my_array = { 1, 2, 3, 4, 5, 6 } | |
view2d = stride.new(my_array, {3, 2}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
world = { | |
physics = { | |
new = function(objtype, d, i, w, h, ubody, ushape) | |
if world.physics[objtype] == nil then world.physics[objtype] = {all = {}} end | |
world.physics[objtype].all[#world.physics[objtype].all+1] = {} | |
world.physics[objtype].all[#world.physics[objtype].all].body = ubody | |
world.physics[objtype].all[#world.physics[objtype].all].shape = ushape | |
world.physics[objtype].all[#world.physics[objtype].all].fixture = love.physics.newFixture(world.physics[objtype].all[#world.physics[objtype].all].body, world.physics[objtype].all[#world.physics[objtype].all].shape, d) | |
world.physics[objtype].all[#world.physics[objtype].all].image = i | |
world.physics[objtype].all[#world.physics[objtype].all].width = w |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local DOUBLE_IEEE_ACCURACY = 1e-8 | |
local function areFuzzyEqual(a, b, accuracy) | |
return (math.abs(a-b) < (accuracy or DOUBLE_IEEE_ACCURACY)) | |
end | |
local function derivative(f, x0, accuracy) | |
local h = 0.1 | |
local xL, xR = x0 - h, x0 + h | |
local tAccr = (f(xR) - f(xL))/(2*h) |
At this point, I find it important to reflect on what I have done, because it is a personal achievement for myself in many ways, but also to the LÖVE developers and the open source community. I'd like to say that without the open source community, none of this would have been possible, even remotely.
Context is due, so I will begin where every writer would begin, at the start.
I'm a big game compo jam participator. Most of the games I have made have been for game jams (Ludum Dare, Bacon Game Jam, and a few other lesser known ones) and I intend on doing more of them. Not only do they provide me with a greater understanding of game design, but they sharpen my game development skills.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Calls f(...) n-times | |
local function time(nm,times, f,...) | |
local st = os.clock() | |
for i = 1, times do | |
f(...) | |
end | |
local et = os.clock() | |
print(('(%s): Times (%d): %.2f ms') | |
:format(nm, times, (et-st)*1000)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[-- | |
Use this file to specify System preferences. | |
Review [examples](+C:\Dokumente und Einstellungen\dr\Desktop\ZeroBraneStudioEduPack-0.38-win32\cfg\user-sample.lua) or check [online documentation](http://studio.zerobrane.com/documentation.html) for details. | |
--]]-- | |
local G = ... | |
styles = G.loadfile('cfg/tomorrow.lua')('Zenburn') -- theme | |
NewerOlder