Skip to content

Instantly share code, notes, and snippets.

@JMV38
JMV38 / Controls.lua
Created October 27, 2012 05:52
Real time controllers and menus
--# Main
-- Moving a sprite with a VirtualStick
displayMode(FULLSCREEN)
function setup()
pos = vec2(WIDTH/2, HEIGHT/2)
steer = vec2(0,0)
speed = 400 -- pixels per second
--# Main
-- Test of various controls
displayMode(FULLSCREEN)
function setup()
pos = vec2(WIDTH/2, HEIGHT/2)
steer = vec2(0,0)
@JMV38
JMV38 / gist:4139706
Created November 24, 2012 13:27
Bug saveImage
--# Main
-- 0 conversion
-- unit test of variuos fonctions
function setup()
convert = Convert()
-- types
typeUnitTests()
-- integer
@JMV38
JMV38 / gist:4144412
Created November 25, 2012 17:22
Mesh loader
--# Convert
Convert = class()
-- converting a 3d object into a color image is done in steps:
-- 1/ convert each element of object in an image
-- 2/ assemble the image elements in one big image
-- the reading is the same in inverse order
function Convert:init()
@JMV38
JMV38 / gist:4144835
Created November 25, 2012 19:11
Convert tab
Convert = class()
-- converting a 3d object into a color image is done in steps:
--    1/ convert each element of object in an image
--    2/ assemble the image elements in one big image
-- the reading is the same in inverse order
function Convert:init()
end
@JMV38
JMV38 / kraizyCircles v06
Last active December 10, 2015 03:38
kraizyCircles
--# Main
-- 0 chemin 00
-- copyright JMV38 2012 - all rights reserved
displayMode(FULLSCREEN)
setInstructionLimit(0)
-- Use this function to perform your initial setup
function setup()
@JMV38
JMV38 / Ants v2
Last active December 11, 2015 04:08
Ant simulation v2 Update v2.1 added the behavior so ants are not stuck on obstacles
--# Main
-- 0 fourmi
-- copyright JMV38 2013 - all rights reserved
displayMode(FULLSCREEN)
supportedOrientations(LANDSCAPE_ANY)
function setup()
-- codea settings
@JMV38
JMV38 / BlacK screen bug
Created February 11, 2013 06:20
Black screen bug
--# Window
Window = class()
-- functionnalities:
-- a window name + close button (x) + minimize/maximize button (_)/(=)
-- print
-- 1 touch: move the window
-- 2 touches: resize h, resize v
-- 1 touch long press: print txt, save to documents image dialog
@JMV38
JMV38 / Bsbs
Last active December 19, 2015 20:48
Back screen bug solution
-- fix the black screen problem by dave1707
function setup()
    project = "forum bone simeon" --YOUR PROJECT NAME HERE
    projectTabs = listProjectTabs(project)
    for t = 1, #projectTabs do
        fix(project..":"..projectTabs[t])
    end
    print("finished")
@JMV38
JMV38 / gist:6150470
Last active December 20, 2015 14:59
Wait function
    
local wait = function (delay,DoSomething)
    tween.delay(delay,DoSomething)
end
XFC.Functions.wait = wait