This file contains hidden or 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
| ACTIVATION_RESPONSE = 1 | |
| NeuralNetwork = { | |
| transfer = function( x) return 1 / (1 + math.exp(-x / ACTIVATION_RESPONSE)) end --This is the Transfer function (in this case a sigmoid) | |
| } |
This file contains hidden or 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
| -- catmull-rom-spline library | |
| -- Resources: | |
| -- https://gist.github.com/1383576 | |
| -- http://codeplea.com/simple-interpolation | |
| -- http://codeplea.com/introduction-to-splines | |
| require("tablelib") -- https://gist.github.com/HoraceBury/9307117 | |
| require("mathlib") -- https://gist.github.com/HoraceBury/9431861 |
This file contains hidden or 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
| //This quick guide will show you how add an optional web-app (iOS) view to your Twine game! | |
| //First you'll need to open up your Twine (.tws) file. | |
| 1. Add a new passage to your story and name it "script" | |
| 2. Enter the tags section and add the word "script" | |
| 3. Now, in the main body, add the code: | |
| document.addEventListener('touchmove', function(e) { | |
| e.preventDefault(); | |
| }, false); |
This file contains hidden or 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
| io.output():setvbuf("no") -- Don't use buffer for console messages | |
| display.setStatusBar(display.HiddenStatusBar) -- Hide that pesky bar | |
| local top = display.contentCenterY - display.actualContentHeight/2 | |
| local bottom = top + display.actualContentHeight | |
| local left = display.contentCenterX - display.actualContentWidth/2 | |
| local right = left + display.actualContentWidth | |
| local allBalloons = {} |
This file contains hidden or 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
| --[[ | |
| Perspective v2.0.2 | |
| A library for easily and smoothly integrating a virtual camera into your game. | |
| Based on modified version of the Dusk camera system. | |
| v2.0.2 adds a more stable tracking system and re-implements scrollX and scrollY | |
| --]] |
This file contains hidden or 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 test | |
| 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 hidden or 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
| -- swipe library | |
| --[[ Libraries ]]-- | |
| local composer = require("composer") | |
| --[[ Fields ]]-- | |
| local mainstage = display.getCurrentStage() | |
| local stage = composer.stage |
This file contains hidden or 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
| -- debug console | |
| local widget = require("widget") | |
| local lib = {} | |
| local originalPrintFunc = print | |
| local debugPrintFunc = nil | |
| local showingDebugConsole = false |
This file contains hidden or 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 sm = require("statemachine") | |
| local process = sm.new(function(self, time) | |
| local txt = display.newText( "Press Me", display.contentCenterX, display.contentCenterY, native.systemFont, 32) | |
| txt:addEventListener("touch", function(evt) | |
| self:continue() | |
| end) | |
| self:waiting() | |
| txt.text = "Hello!" | |
| end) |
This file contains hidden or 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 sm = require("statemachine") | |
| local process = sm.new(function(self, time) | |
| self:sleep(100) | |
| print("hello") | |
| self:sleep(100) | |
| print("hehe...") | |
| self:sleep(100) | |
| print("end") | |
| end) |
NewerOlder