Skip to content

Instantly share code, notes, and snippets.

View chrisdugne's full-sized avatar
🎶
Keep inspired

Chris chrisdugne

🎶
Keep inspired
View GitHub Profile
@chrisdugne
chrisdugne / Maperial-:-Your-first-map.markdown
Created November 18, 2014 21:36
Maperial : Your first map
local t = 700
local R = (x - toX) * 0.5
transition.to(starHUD, {
time = t,
x = x - 2*R,
rotation = 360,
xScale = 0.2,
yScale = 0.2,
transition = easing.inOutSine
@chrisdugne
chrisdugne / github.stylish.css
Last active March 23, 2023 10:37
my GitHub Darkside of the Moon Theme
body {
background-color: #2A2C2F;
color: #E6E6E6;
}
a {
color: #72B0FF;
}
.social-count {
background: #212225;
border-color: #424548;
@chrisdugne
chrisdugne / list-files.lua
Created September 23, 2018 19:48
list-files.lua
local lfs = require ( "lfs" )
function showFolder(folder)
print('===================== ' .. folder)
local path = system.pathForFile( folder, system.ResourceDirectory )
for file in lfs.dir ( path ) do
print (file)
end
end
@chrisdugne
chrisdugne / scale-and-center.md
Last active October 14, 2022 16:35
github: scale and align image
<p align="center">
  <img 
    src="https://user-images.githubusercontent.com/910636/52334105-3be87480-29ff-11e9-9249-0981514d320d.gif" 
    width="300"
  >
</p>
@chrisdugne
chrisdugne / corona-stutter.lua
Created February 20, 2019 00:16
corona-stutter.lua
local spaceship = display.newGroup()
App.hud:insert(spaceship)
spaceship.y = display.contentHeight - 100
spaceship.x = display.contentWidth * 0.5
local image = display.newImage(
spaceship,
'assets/images/game/spaceship.png',
0, 0
)
@chrisdugne
chrisdugne / alternate-vertical-positioning.lua
Created March 22, 2019 16:06
vertical positioning, 2 by 2
local alternate = require 'cherry.libs.alternate'
self.buttons = {}
for i = 1, #keys do
self.buttons[#self.buttons + 1] =
createButton({
name = 'button-' .. i,
parent = scroller,
x = display.contentWidth / 2 + alternate(i) * 100,
local paint = {
type = 'gradient',
color2 = {colorize('#ffffff')},
color1 = {colorize('#00B0FF')},
direction = 'down'
}
local rect = display.newRect(self.view, W / 2, H / 2, W, H)
rect.fill = paint
local cardW = W * 0.9
local cardH = 250
local SR = 3 -- shadow radius
local SA = 0.4 -- shadow alpha
local card = display.newGroup()
options.parent:insert(card)
card.x = options.x
card.y = options.y
@chrisdugne
chrisdugne / spirit.lua
Created April 8, 2019 21:06
Demo corona spritesheet animation
local Spirit = {}
local idle = {
name = 'idle/18',
frames = {
{x = 0, y = 0, width = 111,height = 172},
{x = 111, y = 0, width = 111,height = 172},
{x = 222, y = 0, width = 111,height = 172},
{x = 0, y = 172,width = 111,height = 172},
{x = 111, y = 172,width = 111,height = 172},