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
-- polygon concave | |
require("mathlib") | |
stage = display.getCurrentStage() | |
local text = display.newText{ text="- - -", x=display.contentCenterX, y=100, fontSize=24 } | |
lines = display.newGroup() | |
lines:insert(display.newGroup()) |
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 function angleOnTarget( e ) | |
local a = math.atan2( e.y-e.target.y, e.x-e.target.x ) * 180 / (4*math.atan(1)) | |
if (a<0) then a=a+360 end | |
return a | |
end | |
local function tap(e) | |
e.target.touchMode = "drag" | |
print("drag mode") | |
e.target.dragtimer = timer.performWithDelay( 400, function() |
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
-- collision library | |
local collisionslib = {} | |
local categoryNames = {} | |
local categoryCounter = 1 | |
local function newCategory( name ) | |
categoryNames[ name ] = categoryCounter | |
categoryCounter = categoryCounter * 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
-- rgb | |
-- Colors referenced from http://www.tayloredmktg.com/rgb/ | |
local RGB = { | |
neoncyan = {16, 174, 239}, -- Neon Cyan | |
neonyellow = {231, 228, 37}, -- Neon Yellow | |
neonpink = {231, 83, 177}, -- Neon Pink | |
neongreen = {4, 228, 37}, -- Neon Green | |
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
using System; | |
using System.Collections.Generic; | |
using System.Runtime.Caching; | |
namespace CacheServices | |
{ | |
public class Cache | |
{ | |
protected MemoryCache _cache = new MemoryCache("general"); |
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
-- circle lib | |
require("mathlib") | |
display.setDefault( "isAnchorClamped", false ) | |
local min, max = -10000000000000, 10000000000000 | |
local cache = {} | |
local circlelib = {} |
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
require("mathlib") | |
require("graphicslib") | |
require("tablelib") | |
local function asPoint( x, y ) | |
return { x=x, y=y } | |
end | |
local function getPoint( path, index ) | |
return { x=path[index], y=path[index+1] } |
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
-- display lib | |
local newShapeList = { | |
"newCircle", | |
"newContainer", | |
"newEmbossedText", | |
"newEmitter", | |
"newGroup", | |
"newImage", | |
"newImageRect", |
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
-- graphics extension library | |
require("mathlib") -- https://gist.github.com/HoraceBury/9431861 | |
require("displaylib") -- https://gist.github.com/HoraceBury/1e2ce033e3441823038eb88b551ad981 | |
-- https://math.stackexchange.com/questions/2269589/calculate-angle-of-the-next-point-on-a-circle | |
--[[ | |
Generates a table of points containing the outline of a circle with each point 'step' pixels from the previous. | |
Parameters: |
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
using System; | |
using NUnit.Framework; | |
using System.Data; | |
namespace RandomTests | |
{ | |
[TestFixture] | |
public class NumberTests | |
{ | |
public static void Main(string[] args) |
OlderNewer