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
| function deepcopy(orig) | |
| local orig_type = type(orig) | |
| local copy | |
| if orig_type == 'table' then | |
| copy = {} | |
| for orig_key, orig_value in next, orig, nil do | |
| copy[deepcopy(orig_key)] = deepcopy(orig_value) | |
| end | |
| setmetatable(copy, deepcopy(getmetatable(orig))) | |
| else -- number, string, boolean, etc |
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
| --# Main | |
| -- Flood | |
| function setup() | |
| if backup then backup("Flood 101") end | |
| parameter.integer("Size",10,30,15) --size of board | |
| parameter.action("Start",Start) --starts a new game | |
| parameter.integer("Moves_so_far",0,100,0) | |
| parameter.action("Undo",UndoMove) | |
| --set up palette of six colors |
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
| supportedOrientations(LANDSCAPE_ANY) | |
| -- Use this function to perform your initial setup | |
| function setup() | |
| parameter.number("noiseScale", 1/30, 1, 1/5) | |
| parameter.number("noiseSpeed", 0.05, 1, 0.2) | |
| parameter.integer("Red",0,255,0) --these parameters added | |
| parameter.integer("Blue",0,255,255) | |
| parameter.integer("Green",0,255,150) | |
| parameter.integer("Alpha",0,255,0) |
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
| --# Main | |
| -- Main | |
| function setup() | |
| parameter.integer("Game",1,2,1) | |
| games={Game1,Game2} | |
| end | |
| function SetupGame() | |
| if g then g:cleanup() end | |
| g=games[Game] |
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
| --# Main | |
| -- Main | |
| function setup() | |
| t=Track1() | |
| end | |
| function draw() | |
| t:draw() | |
| 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
| --# Main | |
| -- Main | |
| function setup() | |
| t=Track2() | |
| parameter.boolean("Rays",true) | |
| end | |
| function draw() | |
| t:draw() |
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
| --# Main | |
| -- Main | |
| function setup() | |
| if Backup then Backup("TrackDemo 200") end | |
| t=Track3() | |
| parameter.boolean("Rays",true) | |
| end | |
| function draw() |
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
| function setup() | |
| --use the emoji viewer software to get the number of the icon you want | |
| --(when viewing a page of icons, press on the one you want, and note the number | |
| emoji=unicode2UTF8(128120) | |
| end | |
| function draw() | |
| background(0) | |
| font("AppleColorEmoji") | |
| fontSize(128) |
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
| --# Main | |
| -- Main | |
| function setup() | |
| parameter.integer("Size",10,100,25) | |
| parameter.action("Create",createMaze) | |
| parameter.action("Solve",SolveMaze) | |
| offset={x=50,y=50} --offset of maze from bottom left corner | |
| 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
| --# Main | |
| -- Main | |
| function setup() | |
| setupParameters() | |
| end | |
| --this function shows how to include/exclude parameters that show on the left of screen | |
| function setupParameters(showTextClose) |