Skip to content

Instantly share code, notes, and snippets.

View mroberti's full-sized avatar

Mario Roberti mroberti

View GitHub Profile
@mroberti
mroberti / main.rb
Created April 9, 2020 21:12
Dragon Ruby high tech paragraph generator
$gtk.reset()
$xStart = 0
$xLocation = 0
$yLocation = 720
$width = 200
$height = 300
$lineThickness = 2
$lineSpacing = 4
def defaults args
args.state.theBorders ||= []
$screenW = 1280
$screenH = 720
$centerX = $screenW/2
$centerY = $screenH/2
def tick args
defaults args
render args
input args
calc args
end
def tick args
# defaults
args.state.start_x ||= 10
args.state.end_x ||= 1260
args.state.start_tick ||= 180
args.state.duration ||= 300
# calc
next_percentage = ease_percentage current_tick: args.state.tick_count,
start_tick: args.state.start_tick,
def tick args
# defaults
args.state.start_x ||= 10
args.state.end_x ||= 1260
args.state.start_tick ||= 180
args.state.duration ||= 300
# calc
next_x = ease current_tick: args.state.tick_count,
start_tick: args.state.start_tick,
@mroberti
mroberti / main.lua
Created November 29, 2012 17:41
mathlib demo 'IsOnRight'
require("mathlib")
gameBoard = display.newGroup()
screenW = display.contentWidth
screenH = display.contentHeight
centerX = display.contentWidth/2
centerY = display.contentHeight/2
local mRand = math.random