Skip to content

Instantly share code, notes, and snippets.

View nadar71's full-sized avatar
🏠
Working from home

Simone Mapelli nadar71

🏠
Working from home
View GitHub Profile
-- swipe library
--[[ Libraries ]]--
local composer = require("composer")
--[[ Fields ]]--
local mainstage = display.getCurrentStage()
local stage = composer.stage
-- arrow test
-- http://www.iforce2d.net/b2dtut/sticky-projectiles
-- video: http://screencast.com/t/vcPLSJR6xkIq
require("mathlib")
local sWidth, sHeight = display.actualContentWidth, display.actualContentHeight
local centerX, centerY = sWidth/2, sHeight/2
@nadar71
nadar71 / modal.lua
Last active August 29, 2015 14:14 — forked from vsergeyev/modal.lua
-----------------------------------------------------------------------------------------
--
-- modal.lua
--
-- Modal dialog for Corona SDK
-- V. Sergeyev
--
-- Usage:
-- showDialog("You completed the level. \n1st place.", "Next level", "level2", beforeNext)
--
-- Corona Game SDK example of how to let two bodies circle each other by applying a continuous, attracting force
--
-- The example uses the physics engine, sets gravity to 0, creates two balls separated in the x-direction,
-- with initial speeds in opposite y-direction.
-- Thru an enterFrame event handler, an attracting force is continuously applied to both balls with body:applyForce().
-- The force is normalized over the distance between the two balls.
-- By playing with the initial speed and force factors, you can make the balls spin faster/slower in circles or ellipses
--
-- Save this file as "main.lua" in a project directory and load it in the simulator
--
@emmaguy
emmaguy / gist:81f87b3ceb0721aa509e
Last active July 17, 2020 00:43
SeekBarWithIntervals
public class SeekBarWithIntervals extends LinearLayout {
private LinearLayout mLinearLayout = null;
private SeekBar mSeekBar = null;
private int WidthMeasureSpec = 0;
private int HeightMeasureSpec = 0;
public SeekBarWithIntervals(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
@bobcgausa
bobcgausa / exploder
Created March 6, 2014 01:20
Lua polygon exploder and triangulator
--bobcook47@hotmail.com
--M.I.T. license
physics=require ("physics")
physics.start()
physics.setGravity(0,0)
local noObject = true
local function create()
local vertices = { 0,-110, 27,-35, 105,-35, 43,16, 65,90, 0,45, -65,90, -43,15, -105,-35, -27,-35 }
local r, g, b = math.random(),math.random(),math.random()
local o = display.newPolygon( 0, 0, vertices )
@H4ch1k0
H4ch1k0 / bodySeparator.lua
Last active October 6, 2019 18:09
This is the port to LUA and Corona SDK of the Convex Separator for Box2D class written by Antoon Angelov.
------------------------------------------------------------------------------------------------------------------------
--Convex Separator for Box2D Flash for Corona SDK
--The original class has been written by Antoan Angelov.
--This LUA port was done by Ragdog Studios SRL (http://www.ragdogstudios.com)
--It is designed to work with Erin Catto's Box2D physics library implementation in Corona SDK (http://www.coronalabs.com)
--Everybody can use this software for any purpose, under two restrictions:
--1. You cannot claim that you wrote this software.
--2. You cannot remove or alter this notice.
--How to use it:
@akuzemchak
akuzemchak / Side Bar.sublime-menu
Created August 13, 2011 15:35
Reveal folder in Finder for Sublime Text 2
# add this to the main command array...
{ "caption": "Open Containing Folder…", "command": "open_this_folder", "args": {"dirs": []} }