Skip to content

Instantly share code, notes, and snippets.

@okabsd
Last active October 24, 2016 04:00
Show Gist options
  • Save okabsd/7281c8ba2b3cd152328f769612d935c3 to your computer and use it in GitHub Desktop.
Save okabsd/7281c8ba2b3cd152328f769612d935c3 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -eq 0 ] || [ "$1" == "" ]; then
echo 'Game name required.'
exit 1
fi
mkdir -p $1/clones
git clone https://github.com/Okahyphen/base $1/clones/base
git clone https://github.com/Okahyphen/construct $1/clones/construct
git clone https://github.com/Okahyphen/screenplay $1/clones/screenplay
mkdir $1/construct $1/screenplay
mv $1/clones/base/src/base.lua $1/base.lua
mv $1/clones/construct/src/* $1/construct
mv $1/construct/construct.lua $1/construct/main.lua
mv $1/clones/screenplay/src/* $1/screenplay
touch $1/conf.lua $1/main.lua
echo "For the `base', `construct', and `screenplay' libraries:\n" >> $1/LICENSE
cat $1/clones/screenplay/LICENSE >> $1/LICENSE
mkdir -p $1/assets/sounds $1/assets/sprites
mkdir $1/data $1/game $1/scenes
# Cleanup
rm -rf $1/clones
-- Fill in the blanks
local gfx, win, time =
love.graphics, love.window, love.timer.getTime
local director = require 'screenplay.Director' ()
function love.load ()
director:register_set {
[''] = require 'scenes.' -- Scenes
} :mount -- Default scene
end
function love.update (dt)
director:process(dt, time())
end
function love.draw ()
director:render(gfx, win)
end
function love.keypressed (k, s, r)
director:handle {
type = 'keypress',
data = {
key = k,
scancode = s,
is_repeat = r
}
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment